求一个最简单的jquery图片切换效果。

2025-02-27 23:17:09
推荐回答(1个)
回答1:

给第二个li加个display:none
js部分

$(document) .ready(function(){
$(".men")
.stop(false,true)
.hover(function()
{
$(this).find('li:eq(0)').stop(false,true).hide();//隐藏第一个
$(this).find('li:eq(1)').stop(false,true).show();//显示第二个

},function() {
$(this).find('li:eq(1)').stop(false,true).hide();
$(this).find('li:eq(0)').stop(false,true).show();

});
});
别忘了调用jquery的js文件