JS制作闪动的图片

 1   var t;
 2         function showportal() {
 3             if ($("#图片ID").is(":hidden"))
 4                 $("#图片ID").show();
 5             else
 6                 $("#portal").hide();
 7             t = setTimeout('showportal()', 300);
 8         }
 9 
10 闪动11  showportal() ;
12 停止闪动13 clearTimeout(t);
14 鼠标移动到图片图片停止闪动 移开继续闪动 15 $("#图片ID").bind("mouseover", function () { clearTimeout(t); }); 16 $("#图片ID").bind("mouseout", function () { showportal(); })
17 移出鼠标事件 18 $("#图片ID").unbind("mouseover"); 19 $("#图片ID").unbind("mouseout");

 

posted @ 2014-06-11 13:10  ybyi  阅读(866)  评论(0编辑  收藏  举报