【问题标题】:Facing issue in elevateZoom jquery liferayelevateZoom jquery liferay中面临的问题
【发布时间】:2015-02-01 23:58:25
【问题描述】:

我使用 elevateZoom jquery 在 liferay 中缩放图像。我将我的 js 文件放在 css 文件夹中。并使用以下脚本

<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>

但它给了我以下警告和错误 警告

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}

错误

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

我该如何解决这个错误。有没有其他方法可以在 liferay 中缩放图像? 请帮忙

谢谢

【问题讨论】:

    标签: javascript jquery jquery-plugins liferay liferay-6


    【解决方案1】:

    404 错误是针对 style.css 而不是 js,所以请检查该路径中是否有文件


    关于 js 错误 init elevatezoom on document ready,请确保已加载 jquery。您可以添加fallback for loading jquery locally。检查其他部分也可能有其他东西杀死你的页面

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

    【讨论】:

    • 检查你的代码的其他部分你的页面被破坏的地方,你是否修复了 style.css 的链接
    • 我解决了错误 TypeError.. 购买我无法缩放图像。它不工作
    • 你能设置一个 jsfiddle
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多