Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onMouseDown - Repetive fire?

Status
Not open for further replies.

Bentley22

Programmer
Aug 29, 2001
205
CA
I'm trying to make a panning function for an image viewer, and currently a user has to click a button multiple times to pan the image. Is there some way I can make this fire repetivily if the user holds their mouse down over the button?
 
you could seperate the event in to the two smaller events: onmousedown and onmouseup. then just have a repeating function (with setTimeout or setInterval) triggered onmousedown and clear the timeout or interval onmouseup. Robert Carpenter
questions? comments? thanks? email me!
eclipse_web@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
also, you probably should set the onmouseout handler to clear the timeout, so that if the user drags off the button it also clears. Robert Carpenter
questions? comments? thanks? email me!
eclipse_web@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
;-):) Robert Carpenter
questions? comments? thanks? email me!
eclipse_web@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top