JS制作闪动的图片

时间:2014-06-12 18:59:32   收藏:0   阅读:264
bubuko.com,布布扣
 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");
bubuko.com,布布扣

 

JS制作闪动的图片,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!