简体   繁体   中英

Adding custom jquery on a Weebly e-commerce product page

I am trying to style my Weebly e-commerce product pages by adding a few simple lines of jquery code.

So far, any place I try to add the code doesn't work. I've tried: 1. Adding the code directly to the page layout file in both the header, and right before the closing body tag 2. Adding the script as a "Custom HTML" drop in page object

Using method one, I can inspect the page, and I see that the code snippit I added is coming up on the page, but the script will not run. The script I am trying to add is the following:

<script type="text/javascript">
        $(document).ready(function() {
                $('#wsite-com-product-pricearea').clone().insertAfter("#insert-after-here");
            });
</script>

Does anyone have any experience adding jquery to weebly's e-commerce product pages? Any help would be appreciated. Alex

(function($) {
  $(function() {
    $('.wsite-product-description').prepend($('#wsite-com-product-short-description').html());
    var $btn = $('#wsite-com-product-buy');
    $('.wsite-product-description').first().append('<div id="something-cool"/>');
    $btn.appendTo('#something-cool').css('top', 0);
  });
})(jQuery);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM