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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mouse down event detection...

Status
Not open for further replies.

jstar7

Programmer
Dec 17, 2002
61
GB
Hi guys,

ok so I have a grid of table cells. I have a script which is carried out on mouseover of a cell. Now the problem is I only want the script to run if the left mouse button is down.

I will obviuosly need an if statement of sorts...but not sure on how to detect if left mouse button is being pressed.

I dont mean onclick either....because if the mouse button is clicked on cell 1, not released, and dragged to cell 2 I still want the script to run for both cells.

Thanks for any help in advance...and if im not making sense then tell e and ill try to explain it better.

Cheers, Jonny

-------------------------------------------------

 
You can also use <td onclick=&quot;myfunction();&quot;>, the difference being that onclick executes when the button is released, and onmousedown executes when the button is down. onmousedown is used alot for handling dlick-and-drag scenarios.

Take Care,
Mike
 
cheers guys....wasnt aware that there was an onmousedown event/function.

jonny

-------------------------------------------------

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top