0

I use elevateZoom jquery for zooming image in liferay. I put my js file in css folder. and use following script

<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src='/css/jquery.elevatezoom.js'></script>
<script>
 jQuery("#zoom_01").elevateZoom({  

    zoomType: "inner",
cursor: "crosshair",
zoomWindowFadeIn: 500,
zoomWindowFadeOut: 750
   }); 

</script>

But it gives me follwing warning and error warning

07:19:51,317 WARN  [http-bio-8081-exec-76][code_jsp:128] {code="404", msg="/resources/demos/style.css", uri=/resources/demos/style.css}

error

TypeError: jQuery(...).elevateZoom is not a function

How can i resolved this error. Is there any other way for zooming image in liferay? please help

Thanks

user3855589
  • 1,113
  • 2
  • 15
  • 43

1 Answers1

0

404 error is for style.css not js so check if there is a file in that path


regarding js error init elevatezoom on document ready, make sure jquery is loaded. You may add a fallback for loading jquery locally. Check other parts too there may be something else killing your page

$(function(){

  $("#zoom_01").elevateZoom({  
    zoomType: "inner",
    cursor: "crosshair",
    zoomWindowFadeIn: 500,
    zoomWindowFadeOut: 750
  }); 

});
Community
  • 1
  • 1
shaN
  • 798
  • 12
  • 23