开发者

Jquery hover lock up

开发者 https://www.devze.com 2023-03-06 16:34 出处:网络
This imageswitch fade animation locks up sometimes when mousing out and leaves the \'facebookblue.png\' in place until the next mouseover?

This imageswitch fade animation locks up sometimes when mousing out and leaves the 'facebookblue.png' in place until the next mouseover?

$("#facebookrollover").hover(function(){  
   $("#facebookimg").stop(true, true).ImageSwitch({NewImage:"facebookblue.png",  Speed:200});
},
function(){
   $("#facebookimg").stop(true,开发者_如何学运维 true).ImageSwitch({NewImage:"facebookgrey.png", Speed:400});
 });

And the html part:

<a id="facebookrollover" href="http://www.facebook.com"><img id="facebookimg" src="facebookgrey.png" alt="Facebook" /></a>

Oh and I'm using the imageswitch jquery plugin, but I doubt that that is the problem, since I get same problem when just changing the opacity.


You could do this with only css: place two img tags inside a one hidden by default, and switch therir display property on :hover. Or even better combine them in sprite and just change background-position.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号