function myfunction(){
$('button').click(function(){
alert();
});
}
myfunction();
$('#x').off('click', myfunction);//click disable myfunction();
<button></button>
<span id='x'></span>
我需要禁用功能,我已經嘗試過的jQuery,但它不工作jQuery的禁用功能
誰能告訴我怎麼樣?以及如何再次啓用?
你想要什麼到底是什麼?從您的描述中不清楚。 – 2014-09-21 20:09:43
當#x點擊,禁用myfunction() – Ben 2014-09-21 20:10:15
什麼是'#x'',你試圖禁用哪個函數?你想切換'點擊'處理函數嗎? – ne1410s 2014-09-21 20:11:16