在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ jquery怎樣把代碼封裝成插件在各個(gè)頁面中調(diào)用,不用寫相同的類名ID名?

jquery怎樣把代碼封裝成插件在各個(gè)頁面中調(diào)用,不用寫相同的類名ID名?

$(function(){
    var isBox = false; 
    $("#select").hide();   
      
    $("#input_select").focus(function () { 
      $(this).siblings("#select").show();   
      isBox = true;  
    });  
    $("#mousemove").mousemove(function () { 
      isBox = true;  
    });  
    $("#mousemove").mouseout(function () { 
      isBox = false;  
    });  
    $("#input_select").blur(function () { 
      if (isBox == true) return false;  
      $("#select").hide();  
    });  
    $("#select").find('li').each(function () { 
      $(this).on("click", function () {  
        isBox = false;  
        var text = $(this).text();  
        $("#input_select").val(text);  
        $("#select").hide();  
      })  
    })
})
回答
編輯回答
吢涼
2017年6月26日 09:08