Click to See Complete Forum and Search --> : scroll iframe


zbgump
12-01-2003, 10:13 AM
I'm doing a site for somebody who needs a scrollable news secion in the homepage.

She wanted custom graphics for the scroll arrows, so I used code found here (http://www.dynamicdrive.com/dynamicindex17/iframescroll_dev.htm). Thats one of many dhtml scrollers that I've found on the web.

Well, what she wants now is for the text to only scroll as the arrow is clcked, not scroll continuously on rollover. Since I have to set scrolling=0 to hide the browser scroll bars, I can't simply use window.scrollby().

Anyone have any advice that might get me off on the right foot with this one?

Pittimann
12-01-2003, 10:54 AM
Hi!

Instead of the onmouseover and onmouseout in the original code just use:
-----------
<a href="#" onMouseDown="scrollspeed=-2" onMouseUp="scrollspeed=0">Up</a> | <a href="#" onMouseDown="scrollspeed=2" onMouseUp="scrollspeed=0">Down</a>
-----------
That would have the effect that as long as the mousebutton is down the content will be scrolled. When the mouse button is released, scrolling will stop.

If you really meant "... as the arrow is clicked" just use:
-----------
<a href="#" onClick="scrollspeed=-2" onMouseOut="scrollspeed=0">Up</a> | <a href="#" onClick="scrollspeed=2" onMouseOut="scrollspeed=0">Down</a>
-----------
(One click on the arrow=scroll, when mouse leaves the arrow=no scrolling)

Cheers - Pit

zbgump
12-01-2003, 10:58 AM
OMFG!!

I feel like an idiot!!



THANK YOU!!!:)

Pittimann
12-01-2003, 11:05 AM
Hi zbgump!

I feel like an idiot!!

This was honestly not my intention!!!

:D cheers - Pit