Jump to content

Adding a jquery plugin on a blog post

Recommended Posts

Site URL: https://www.meridianacademy.org/division3-humanities/2020/5/6/civil-rights-quilt

I'm trying to add the elevateZoom jquery plugin (https://www.elevateweb.co.uk/image-zoom/) to my site. I'm then trying to call it for a specific image on this page: https://www.meridianacademy.org/division3-humanities/2020/5/6/civil-rights-quilt.

I've uploaded the plugin as a link and added it to my site's head via code injection.

I then called it on the page via a codeblock:

<script>
$(document).on('ready', function () {
    $("#block-yui_3_17_2_1_1588791147485_100779").elevateZoom({
zoomType: "inner",
cursor: "crosshair",
zoomWindowFadeIn: 500,
zoomWindowFadeOut: 750
   }); 
});

</script>

But it does not seem to be working. Any help would be much appreciated. Thanks!

Link to comment
  • Replies 5
  • Created
  • Last Reply
  • 5 months later...

I'm trying to do the same thing to effect all shop product images with the following code but it is not working.

 

<script>
	$(document).on('ready', function () {
		$('#productList .product .product-image img, #productSlideshow .slide img').each(function () {
			$(this).attr('data-zoom-image',$(this).attr('data-image'));
				$("#productList .product .product-image img, #productSlideshow .slide img").elevateZoom();({cursor:"crosshair"});
    }):
 }):
</script>

 

Link to comment
On 11/8/2020 at 9:02 AM, LostBoy said:

I'm trying to do the same thing to effect all shop product images with the following code but it is not working.

 


<script>
	$(document).on('ready', function () {
		$('#productList .product .product-image img, #productSlideshow .slide img').each(function () {
			$(this).attr('data-zoom-image',$(this).attr('data-image'));
				$("#productList .product .product-image img, #productSlideshow .slide img").elevateZoom();({cursor:"crosshair"});
    }):
 }):
</script>

 

Try this

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
	$(document).on('ready', function () {
		$('#productList .product .product-image img, #productSlideshow .slide img').each(function () {
			$(this).attr('data-zoom-image',$(this).attr('data-image'));
				$("#productList .product .product-image img, #productSlideshow .slide img").elevateZoom();({cursor:"crosshair"});
    }):
 }):
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
18 hours ago, tuanphan said:

Try this


<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
	$(document).on('ready', function () {
		$('#productList .product .product-image img, #productSlideshow .slide img').each(function () {
			$(this).attr('data-zoom-image',$(this).attr('data-image'));
				$("#productList .product .product-image img, #productSlideshow .slide img").elevateZoom();({cursor:"crosshair"});
    }):
 }):
</script>

 

Nope, nothing. 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.