Anchor links in Google Chrome - Page 2

User 629541 Photo


Registered User
7 posts

Per wrote:

I vaguely remembered having seen a very similar case of different behavior in VSD between Chrome and other browsers quite some time ago. I searched the forums and found this:
http://www.coffeecup.com/forums/designe … m-to-work/

Unfortunately it doesn't really seem to provide a solution but if you read through it, maybe you'll get some ideas... :)


Thanks Per,

I went through the post and the conclusion that you reached in it was similar to mine. The CSS positioning of the anchors as objects could well be causing the issue in Chrome.

If I edit the HTML and put the anchors in the right places manually, it all works fine. But then, as you alluded to in the other post, if I were to re-open the VSD project it would put everything back how it likes it, and my changes would be lost. :)

paintbrush wrote:

Have you tried these without the page name:


Thanks paintbrush, I did give this a shot but it remained the same in Chrome. Also, the anchor link navigation appears across all of the pages of the site so I would need to keep the page name too...


User 2147626 Photo


Ambassador
2,958 posts

Bear in mind, I'm not really a coder, but I did find this. Don't know if it really makes a difference... You had this:

Upon editing the HTML I noticed the anchor objects are all grouped together, for example:

<div class="Object4031"><a name="Mind2"></a></div>

And then these objects are positioned as follows:

div.Object4031 { position:absolute; top:1228px; left:238px; width:15px; z-index:63; }


And I found this:
You are using the wrong attribute and have an extra invalid character as well.

<h2 name="#kids"></h2>

should be

<h2 id="kids"></h2>

then it will work in all browsers except Netscape 4.


So, maybe, change name to id.
Id is used to identify the HTML element through the Document Object Model (via Javascript or styled with CSS). Id is expected to be unique within the page.
Graphics for the web, email, blogs and more!
-------------------------------------
https://sadduck.com
User 187934 Photo


Senior Advisor
20,193 posts

Put the anchors in their own html box so you not altering the source.;) That's what I did.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 629541 Photo


Registered User
7 posts

Gunsmoke wrote:
Bear in mind, I'm not really a coder, but I did find this. Don't know if it really makes a difference...


Hey Gunsmoke,

Thanks for the recommendation. I tried switching <a name= to <a id= , again it unfortunately does not work in Chrome (fine in Firefox!).

Eric wrote:
Put the anchors in their own html box so you not altering the source.


Hey Eric,

As far as I can tell this is exactly how I have done it. Here are two screenshots exampling one of the anchors in Coffecup:

http://www.jakealmond.co.uk/files/Anchor1.JPG
http://www.jakealmond.co.uk/files/Anchor2.JPG

Any more ideas why this isn't working in Chrome? :)

Thanks
User 271657 Photo


Ambassador
3,816 posts

Grasping at straws here...

Since VSD gives everything a z-index number, try clicking on your HTML boxes and then arrange-bring to front. Just to make sure nothing else is over them.

I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com
User 187934 Photo


Senior Advisor
20,193 posts

I would drop the inline font style and use css. I'm thinking this is the issue.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 104702 Photo


Registered User
293 posts

The answer is: page length. If you make the page longer than needed, the problem is gone... I don't know why, but I'm sure this solves the problem. Some time ago I made an example page showing how to use anchors in VSD: http://www.johnvanhulst.com/anchors/ and I loaded this site using Chrome. It showed your problem. I increased the page length and: gone...
The original example, not good, is at the link given above. Click on part 5 and watch the page not going down to section/part 5. Now surf to http://www.johnvanhulst.com/anchors2 and yes: it is OK!

BTW, you might notice the page is 'smooth scrolling'. How do I do this? smooth.pack.js Look at the source code of the page.

Success, John
John van Hulst
User 187934 Photo


Senior Advisor
20,193 posts

I saw a post on forum talking about content length. Thanks for posting that John. Hope it fixes the issue. I would think you could move the anchor down farther then necessary to get it to work
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 1948478 Photo


Senior Advisor
1,850 posts

Jonny,
In a different thread, that addresses a very similar problem, I posted the following a moment ago:
(http://www.coffeecup.com/forums/designe … link-html/)

Per wrote:
Since I have seen this problem pop up occasionally since as far back as 2009, I decided to take a closer look in an attempt to come up with a generic approach that always should work. This is what i came up with:

The problem originates with the positioning of the anchor by this (VSD-generated) combination of CSS and HTML:

div.Object4696 { position:absolute; top:13px; left:947px; width:52px; z-index:19; }
....
<div class="Object4696"><a name="top"></a></div>
....

The page anchor, which should be a well-defined point in 2-dimensional space, becomes ill-defined when coded as a block element (<div></div>), which extends as an arbitrarily drawn rectangle on the page. Some browsers, e.g. Chrome, appears to react badly to this condition...

So instead of defining the page anchor as an arbitrarily drawn rectangle, use an HTML box with this single line of code, which defines a true point location:

<a name="top" style="position:absolute;left:0px;top:0px"></a>

This is for an anchor at the top of the page. For page anchors located elsewhere on the page, just change the "0" in "top:0px;" to the distance down from the top as needed. Keep the horizontal position at the left margin for all cases though ("left:0px;")

By using an HTML box in VSD to define the anchor position, it should stay with the .vnu file and you should not need to edit and re-insert it each time you update something on the site ;) .
User 629541 Photo


Registered User
7 posts

Well well well!

Thank you all for the latest suggestions.

Per! Your latest suggestion appears to have worked magic! :D

http://www.heavenister.com/Dev/EKHDev/EKHTHERAPY.html

In fact, I am not sure why (maybe you could help explain) but simply adding

style="position:absolute;left:0px;top:0px"

To every anchor link, makes it work. There was no need to increase the 0. Perhaps the positioning simply causes VSD to handle the HTML differently?

So anyway - anchor links now work in all browsers! :)

I hope this thread assists any more intrepid Coffeecup adventurers who come along after me!

Thanks to all!

Jake

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.