0
我有jPayPalCart.js切換myCart div的困難。我的購物車功能完美。當我加載頁面時,我可以通過點擊右上角的購物車來切換購物車。我有另一個按鈕,我已經添加到myCart代碼,說「關閉」,並關閉myCart股利。切換問題與購物車jPayPalCart.js
但是,當我將商品添加到購物車時(僅在演示頁上的第一項實際上添加了一個商品),當點擊購物車圖標時不再觸發此功能。我在瀏覽器的控制檯中看不到任何錯誤。
它只在頁面刷新時纔會再次運行。我怎樣才能做到這一點,我不必刷新頁面?
真的很感謝有人幫我解決這個問題,這讓我瘋了兩天。
$(document).ready(function() {
$(".menu").activeMenu();
$("#myCart").hide();
// Create a basic cart
$("#myCart").PayPalCart({
business: '[email protected]',
notifyURL: 'http://www.diditwork.com/payment.aspx',
virtual: false, //set to true where you are selling virtual items such as downloads
quantityupdate: true, //set to false if you want to disable quantity updates in the cart
currency: 'CAD', //set to your trading currency - see PayPal for valid options
currencysign: '$', //set the currency symbol
minicartid: 'minicart', //element to show the number of items and net value
persitdays: 0 //set to -1 for cookie-less cart for single page of products,
// 0 (default) persits for the session,
// x (number of days) the basket will persits between visits
});
$(".cartImg").click(function() {
alert("your hitting it");
$("#myCart").toggle();
});
$(".closeCart").click(function() {
alert("your hitting it");
$("#myCart").hide();
});
});
Reference to script I am using