Bookmarks in TOC or Index

This forum is for all Flare related Tips and Tricks.
Have a tip or trick you use while working in Flare? Share it here.
Post Reply
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Bookmarks in TOC or Index

Post by i-tietz »

Hi folks,
right now I'm facing a problem:
We produce a help with a fixed div at the top of each topic - means: it doesn't scroll when the user scrolls the topic.
So far, so good - the problems came with bookmarks.
We would like to use longer topics for background and concept descriptions and make navigation easier by using bookmarks, usually on headlines. The first problem I faced: If I jump to a bookmark, it's positioned into the top left corner of the topic window - but that's where the fixed div is, so: the text I want to read is beneath that div and I cannot read it. I have to scroll up a bit.
I inserted a javascript into the masterpage that does that scrolling when a bookmark is the target. It works "onload" and "onresize".

But then I had to find out, that with index and TOC entries it's different: Let's say there are TOC entries A and B. They both jump to the same document but different bookmarks. The user clicks on A and everything is fine - the desired headline is there, visible under the fixed div, because my javascript scrolled "onload". Then the user clicks on B and the topic jumps to that bookmark, but no correctional scrolling there, because the "onload" is not triggered ... means: the user doesn't see the desired headline, because it's covered by that fixed div ...

I have one possible solution for that, but it would blow up our projects: Create one dummy topic each for each bookmark addressed in TOC or Index. That dummy topic does a redirect "onload" ... but that could turn out to sth like: 1 concept topic with 10 bookmarks needs up to 9 dummy topics ... apart from that we would have to edit the dummy topics in the text editor to insert the redirection URL - not easy, if you don't know your way around with javascript ...

Since clicking on "B" changes the URL, but doesn't trigger the "onload" handler I thought about this: Checking the URL once every second to find out if it changed compare to the last one. But I don't even know whether that's possible, because I don't know whether the saved, last URL "survives" the jump to the bookmark. The document status seems a bit foggy there ...

Does anybody know more? Or does anybody know another way - maybe with javascript? ... I'm lost.
Post Reply