zoukankan      html  css  js  c++  java
  • jquery实现停留半秒后再选择

    jquery实现tab停留半秒后,选中菜单、切换tab下的内容:

    var showHandler=null;
    function init(){
    	$("#tab_ul").find("li").each(function(index, ele){		
    		var divId = "#nav"+index;
    		$(ele).mouseover(function(){	
                  //定时器,半秒后执行 showHandler = setTimeout(function(){ //实现操作 }, 500); }).mouseout(function(){
                  //判断是否清空定时器 if(showHandler){clearTimeout(showHandler);} }); }); }

      鼠标在tab上停留,设置定时器半秒后事件才执行,如果不到半秒,清空定时器。

  • 相关阅读:
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    export和import 输出/接收模块变量的接口
    webpack:(模块打包机)
  • 原文地址:https://www.cnblogs.com/zhaofeng555/p/3566299.html
Copyright © 2011-2022 走看看