X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Using jquery within Add to Cart Popup (https://forum.x-cart.com/showthread.php?t=67633)

acidon 08-28-2013 10:24 AM

Using jquery within Add to Cart Popup
 
I have a simple jquery code that hides the div in Add to Cart Popup, which I can later manually show/hide:

In Head:

Code:

{literal}<script>
$(document).ready(function() {
  $('#example').hide();
});
</script>{/literal}


In Add to Cart Popup (skin/common_files/modules/Add_to_cart_popup):

Code:

<a onclick="$('#example').show('fast')">Show</a><br />
<div id="example">This is an example of text that will be shown and hidden.<br />
<a onclick="$('#example').hide('fast')">Hide</a>
</div>


It doesn't work. My guess it has something to do with the way the popup is loading (most likely with ajax).

If I try to insert:

Code:

{literal}<script>
$(document).ready(function() {
  $('#example').hide();
});
</script>{/literal}


directly in /common_files/modules/Add_to_cart_popup/product_added.tpl , it works, however it initiates some sort of second popup header overlay, witch I have to close first in order to get to main popup window:
http://compare-best-kettlebells-dvds.com/popup1.jpg

So my question is: How do I get my jquery code to work within Add to Cart Popup without triggering any additional popups?


All times are GMT -8. The time now is 06:48 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.