我需要添加「加載」動畫按鈕後,jQuery函數單擊添加「加載」動畫jQuery的功能按鈕,點擊之後
所以,我有一個功能:
function get_revpopup_cart(product_id, action, quantity) {
quantity = typeof(quantity) != 'undefined' ? quantity : 1;
if (action == "catalog") {
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: 'product_id=' + product_id + '&quantity=' + quantity,
dataType: 'json',
beforeSend: function(){
$('body').addClass('blur2');
$('#pagefader2').fadeIn(70);
},
.............
和這部動畫: <div class="page_gif_progress_icon"><div class="circle"></div></div>
鈕:<a onclick="get_revpopup_cart('103', 'catalog', '1');" data-toggle="tooltip" title="В корзину"><i class="fa fa-border fa-shopping-basket"><span class="prlistb">add in cart</span></i>
我需要添加「加載」動畫before $('body').addClass('blur2');
將OPE ñ並作爲函數執行
感謝
你剛剛做的完全一樣,但我爲你的加載元素創建了變量。也許我在聲明時犯了一些錯誤。仍然很高興你已經解決了它。 –