/    Sign up×
Community /Pin to ProfileBookmark

Named anchors, scrollable divs, and IE for mac, the love story.

Hello !!!!
I’m having a not-so-unexpected problem regarding named anchors on IE mac.
My page is structured like that :
<body>
<div></div>
<div></div>
<div></div>
… <– divs for the design and the menu
<div id=”frame”>
all my stuff inside
</div>
<div></div>
<div></div>
</body>

I defined : base target=”_self”
The problem, on IE mac, is that on my page, if I click a named anchor, instead of going to the targeted thing, it will just reload the page and stay where it was.
I assume it’s because I’m using a scrollable div and not a frame, but it’s annoying.
It works in all other browsers, of course.
Any idea how I could fix that ?
Thanks a lot,
Ness

Edit : if I provide a page, it might be easier… silly me… [URL=http://enfantsdelo.free.fr/map.php]Page[/URL]
Oh, and doesn’t work on Netscape 6.0 either…
second edit : it doesn’t work with Safari either…

So, basically, it works with FF pc and mac, IE pc, Opera 8.

to post a comment
CSS

18 Comments(s)

Copy linkTweet thisAlerts:
@FangJun 02.2005 — Try: [I]document.getElementById('elmID').scrollIntoView(true);[/I]
Copy linkTweet thisAlerts:
@Ness_du_FratauthorJun 03.2005 — thanks for your suggestion, Fang, but I'm not using ANY javascript on the page. I usually do, but for this specific website, I won't.

But it's strange that it's like that...

target=_self is the right thing, no ?

I don't think I made a mistake in defining my anchors, I'm quite used to doing it... ?
Copy linkTweet thisAlerts:
@FangJun 03.2005 — Try with [I]name[/I] and [I]id[/I] with the same value.
Copy linkTweet thisAlerts:
@Ness_du_FratauthorJun 03.2005 — mmm, why not ! I'll give it a try, thanks ! ( I'll keep you informed about that... but later, because now I'm on my pc, with a decent netscape version, and of course, no IE for mac... ? )
Copy linkTweet thisAlerts:
@Ness_du_FratauthorJun 03.2005 — I tried... It doesn't work, at least not in Opera 7.5... ?
Copy linkTweet thisAlerts:
@Ness_du_FratauthorJun 04.2005 — Try: [I]document.getElementById('elmID').scrollIntoView(true);[/I][/QUOTE]

I finally tried this one, and if it works fine in FF, it doesn't work at all on Opera. No improvement.

Anybody ???

Pretty pretty please ? with sugar and cherry on top ? ?
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYJun 04.2005 — thanks for your suggestion, Fang, but [I][B]I'm not using [U]ANY[/U] javascript[/B][/I] on the page. I usually do, but for this specific website, I won't.[/QUOTE]

what about that fading text scroller!? :p
Copy linkTweet thisAlerts:
@FangJun 04.2005 — Some versions of Opera have a problem/bug with anchor bookmarks (7.0 to 7.6 I believe). In Opera8 the links work.
Copy linkTweet thisAlerts:
@Ness_du_FratauthorJun 04.2005 — what about that fading text scroller!? :p[/QUOTE]
héhéhé, that's the only one, and it has a noscript tag as well, so that all browsers not having javascript enabled can still view it ?
Copy linkTweet thisAlerts:
@Ness_du_FratauthorJun 04.2005 — Some versions of Opera have a problem/bug with anchor bookmarks (7.0 to 7.6 I believe). In Opera8 the links work.[/QUOTE]
yeah, I know. But... it doesn't work in Safari ( latest version ), IE for mac ( latest version ), and Netscape 7.5 and earlier, as well as Opera 7.5 and earlier...

It's starting to make a big bunch of browsers... ?
Copy linkTweet thisAlerts:
@FangJun 04.2005 — Some of the bookmarks are wrong:&lt;a name="divers[COLOR=Red]a[/COLOR]" id="diversa" class ...Check them all!

Older browsers can only use [I]name[/I] as a bookmark.
Copy linkTweet thisAlerts:
@Ness_du_FratauthorJun 04.2005 — No, they are not wrong, I just didn't change them. I changed the first three of them, to give them the same name and id, and after that, when I noticed it didn't work, I didn't bother to change the rest of them, as it seemed pointless anyway.

Do you think it might be a problem if some of them are changed and some not ? In that case, I can try to change them all, but I doubt it will make any difference.
Copy linkTweet thisAlerts:
@FangJun 04.2005 — Netscape works with the JavaScript solution. Opera has not implemented [I]scrollIntoView[/I] and has a bug with the bookmarks, except for Opera 8.
Copy linkTweet thisAlerts:
@Ness_du_FratauthorJun 04.2005 — Can I make both the javascript AND the normal anchor in one ?

I mean, if I put the javascript thing, then, what will happen in FF : will FF use the normal anchor or will it use the js ?

Then, what happens in FF if the javascript is turned of ?

I'll give it a try with netscape...
Copy linkTweet thisAlerts:
@FangJun 04.2005 — Something like this:&lt;a href="#xxxx" onclick="document.getElementById('xxxx').scrollIntoView(true);"&gt;bookmark&lt;/a&gt;
In (older versions of ) Opera you will have to change the containers overflow to visible.
Copy linkTweet thisAlerts:
@Ness_du_FratauthorJun 04.2005 — mmm, thanks... actually, I saw that it does work in Netscape 7.0 ( the simple anchor stuff )

What do you mean by changing the containers overflow to visible ? Which containers ?

For the moment, I have overflow : auto; on my pseudo frame...
Copy linkTweet thisAlerts:
@FangJun 04.2005 — <i>
</i>onload=function() {
if(window.opera) { document.getElementById('frame').style.overflow='visible';}
}

which should allow the bookmarks to work in Opera.
Copy linkTweet thisAlerts:
@Ness_du_FratauthorJun 04.2005 — mmm... I tried that, and it didn't work. Moreover, it ruined my design by stretching the page...

I think I'll just stick to the normal version, and if it doesn't work, then the people just can change their browser...

anyway, thanks for your help.
×

Success!

Help @Ness_du_Frat spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...