/    Sign up×
Community /Pin to ProfileBookmark

scroll iframe

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 [url=http://www.dynamicdrive.com/dynamicindex17/iframescroll_dev.htm]here[/url]. 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?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@PittimannDec 01.2003 — 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
Copy linkTweet thisAlerts:
@zbgumpauthorDec 01.2003 — OMFG!!

I feel like an idiot!!



THANK YOU!!!?
Copy linkTweet thisAlerts:
@PittimannDec 01.2003 — Hi zbgump!

I feel like an idiot!![/QUOTE]

This was honestly not my intention!!!

? cheers - Pit
×

Success!

Help @zbgump 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,
)...