這是我的客戶網站http://www.tswanda.co.zw/campaigns/tswanda-childrens-home/當你點擊貢獻時,一個彈出窗口出現與捐贈按鈕,如果你點擊捐贈按鈕2,3或4次,它再次提交值爲結帳。在點擊一次後禁用提交按鈕
我想要一旦提交一筆錢就可以禁用按鈕,請你幫我解決我試圖使用Disabling links to stop double-clicks in JQuery的代碼,但沒有任何工作適合我。
任何幫助將非常感激。
<script type="text/javascript">
function do_nothing() {
return false;
}
// prevent a second click for 10 seconds. :)
jQuery('.edd-add-to-cart').live('click', function(e) {
jQuery(e.target).click(do_nothing);
setTimeout(function(){
jQuery(e.target).unbind('click', do_nothing);
}, 50000);
});
</script>
分享你已經試過 – mohamedrias 2015-03-19 11:11:59
感謝檢查sir..i添加代碼 – Abhi 2015-03-19 11:15:24
看看這個小提琴http://jsfiddle.net/L1y2xmhx/ – 2015-03-19 11:26:13