javascript - does a click also trigger a mouseout in chrome -


i'm testing ratings module i'm working on, had idea simple construction that'd allow smooth ajax based voting, found odd..

the contruction 2 divs, 1 nested in other show stars, mousing on sets width, translated percent vote later on.

in testing this, found worked, when clicked, made width of inner div reset, if moused out, i'm not sure understand why yet. i'm including working example of this.

http://www.nogumallowed.com/test.php

here fixed code:

$(".ratingsblock").mousemove(function(e){     $(".ratingsscale").width(e.offsetx); });  $(".ratingsblock").click(function(e){     $(this).attr("score",e.offsetx);  });  $(".ratingsblock").mouseleave(function(e){     $(".ratingsscale").width($(this).attr('score'));     //$(".ratingsscale").animate({width:$(this).attr('score')+'px'}, 500); }); 

i changed mouseout function mouseleave, , made rating's score update when .ratingsblock clicked.

mouseout weird sometimes...


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -