Welcome Guest, Not a member yet? Register   Sign In
[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.




Theme © iAndrew 2016 - Forum software by © MyBB