2013年4月16日 星期二

jQuery Hover Events

$(selector).hover(handlerIn, handlerOut)

image

 

Highlight #target on mouseenter and set it bck to white on mouseleave

image

Another option is $(selector).hover(handlerInOut), fire the same handler for mouseenter and mouseleave events

image

 

Demo Example:

Mouse over to highligh the row you point to in the table

image

Another same way but using just one function

image

 

Additional Notes:

.toggle(), take turns to change color after mouse click

#efefef –> #fff –> Yellow –> #efefef –> #fff –> …

image

沒有留言:

張貼留言