• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[JS] How to detect current event of mouse with a html element ?

#1
[eluser]Berserk[/eluser]
hi there,
i'm trying to detect "current event" of mouse (hover, click,...etc) with an element in html using javascript. Anyone can tell me ? thanks

#2
[eluser]umefarooq[/eluser]
hi check this article and example will help you

http://www.devirtuoso.com/2009/08/beginn...se-events/

#3
[eluser]mhel_dc[/eluser]
Code:
[quote author="Berserk" date="1257414412"]hi there,
i'm trying to detect "current event" of mouse (hover, click,...etc) with an element in html using javascript. Anyone can tell me ? thanks[/quote]

I suggest adding an EVENT PROPERTY in the HTML tag

Example :

add these following events in your html controls (if the control supports it)

onmouseover = javascript()
onmousedown = javascript()
onmouseup   = javascript()
onmouseout  = javascript()
onmousemove = javascript()

javascript() <- replace this with your javascript function

I guess you can now identify which events your mouse is doing.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.