If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

on mouse over: scroll text

Hello,

I'm hoping to get a code that works something like this:

I would like to have two arrows on the left and right on the side of a box (no border on the box) and when the mouse is put over the arrows, the text between the two arrows (in the box) moves in the direction of the arrows. Between the two arrows (the scrolling text) I'd have links. With this I can have many links at a small place on the page.

Wrap the word you want in an element (anchor link, span, whatever), add an ID to the element, and the call the following function on that ID.

PHP Code:

function scrollToObj(id){// send the scroller to the end, so that any scrolling call would cause it to scroll back instead of forwarddocument.getElementById('scroller').scrollLeft = document.getElementById('scroller').scrollWidth;// store page scrollvar temp = document.documentElement.scrollTop; // scroll to the position of the IDdocument.getElementById(id).scrollIntoView(true);// restore page scrolldocument.documentElement.scrollTop = temp; }

The word should be in the horizontal scroller. And if the entire document has a scrollbar, and the horizontal scroller is not in view, then user will experience a momentary scrollbar movement when this function is called.