Closed Thread Icon

Topic awaiting preservation: Detecting an "internal jump" with dhtml scroller code (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8371" title="Pages that link to Topic awaiting preservation: Detecting an &amp;quot;internal jump&amp;quot; with dhtml scroller code (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Detecting an &quot;internal jump&quot; with dhtml scroller code <span class="small">(Page 1 of 1)</span>\

 
trib
Paranoid (IV) Inmate

From: Den Haag, Netherlands
Insane since: Sep 2002

posted posted 10-31-2002 21:14

Typical of the problem is an FAQ page, where the Q's are in an index at the top, and the answers are lower down the page. With a standard scrollbar, the page location "jumps" to the answer. However, with a DHTML scroller like doc's Znippet code, the window stays stuck at the top, and doesn't jump.

Is there some way of detecting the "page cursor" position inside the div, so that I can reset the viewport to bring that position into the active "window"??

The real-life problem is a lot more convoluted than this, but if I could do this part, I might be able to work out the rest from there.

Thanks in advance,

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 10-31-2002 22:53

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 10-31-2002 23:12

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 11-01-2002 03:11

I'm glad InI know what your trying to do but I'm a little confused.

What's a "page cursor" position exactly?

You also say:

"with a DHTML scroller like doc's Znippet code, the window stays stuck at the top, and doesn't jump"

DHTML scroller apps to windows is a bit of an apples to oranges comparasion. Are you saying that you want to shift the page's content but not alter the Scroll position on the window itself?

If so then um, yes it is possible but it's a little tricky and you'll need to play with it for a while to get it to work. You'd need to use relatively positioned elements and use the document.getElementById("myElement").offsetTop property to get their values.
http://www.mozilla.org/docs/dom/domref/dom_el_ref21.html

If that's not what your trying to do then you'll need to clarify.

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 11-01-2002 07:26

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 11-01-2002 07:51

Arr, yeah, that makes more sense. Hah. Silly me.

In that case your kinda screwed. There is a way to do it but it'd be about as tricky as coding the scroller itself. I was working on soething similar for the scroller I made but I've given that a rest for now.

Although it does still involve the offsetTop property, but you'd need to almost fully deconstruct the logic behind Doc's scroller before you could hack in that kind of functionality. Personally I don't think it would be worth it. You'd also need to set up a function to handle the innerlinks as trying to run something like that off of named <a> elements would be a bit of a bitch too.

I'd recommend you find a different way of displaying the information. You really shouldn't be using DHTML scrollers for huge ammounts of content. The more content they have the worse they perform. And there are still quite a lot of people running on Windows 9.x which has piss poor DHTML performance.

You could always rig up an <iframe> content loader and have a menu to the side of the window that loads each answer to said question into the window dynamically. But if your the determined sort then offsetTop is your friend.

trib
Paranoid (IV) Inmate

From: Den Haag, Netherlands
Insane since: Sep 2002

posted posted 11-01-2002 08:33

Thanks guys .. it's just as I thought. I did go right through Doc's code, and understand it very well. In fact my own version is close, but not exactly, Doc's code. Ini is right about what I was trying to do. It was late in the evening, and I wasn't being ery coherent .. apologies ... I'd been DB programming all day, and in Oracle "cursor" is the word they use to describe the internal pointer to the currently active tuple in a table (well, sort of).

I think I'll end up either putting each answer in a separate div, and then either racking them up in a "vertical heap" of hidden divs and switching on/off the visibility of the relevant one, or else having one visible, empty div, and then reloading its contents using innerHTML, innertext or appendChild/removeChild. In fact, now I think about it more, it might even end up looking sexier than a straight Q&A page ....

Thanks for the input guys. As always, its well appreciated.

Aside ... You do know how we in the tech support world pronounce FAQ .. don't you ?? ... Well we often get so sick of being nice to pissy customers all the time that it's a pleasure to refer them to the FAQ, and then think quietly to ourselves ... ... ... customer .. FA ... Q ...



[This message has been edited by trib (edited 11-01-2002).]

« BackwardsOnwards »

Show Forum Drop Down Menu