jQuery gzoom插件不起作用 [英] jQuery gzoom plugin doesn't work

查看:145
本文介绍了jQuery gzoom插件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 jQuery (出色的)插件 gzoom ( http://lab.gianiaz.com/jquery/gzoom/ http://www.chouselive.co.za/demo/pictures/zoom/gzoom.php ).

I am trying to add a zoom on my image with the jQuery (brilliant) plugin gzoom (http://lab.gianiaz.com/jquery/gzoom/ or http://www.chouselive.co.za/demo/pictures/zoom/gzoom.php).

但是它不起作用.我的图像只是调整了大小,但没有放大.

But it doesn't work. My image is just resized, but there is no zoom in it.

这是我的代码:

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>test gzoom</title>
  <link rel="stylesheet" href="css/jquery-ui-1.7.1.custom.css" type="text/css" media="screen">
  <link rel="stylesheet" href="css/jquery.gzoom.css" type="text/css" media="screen">
  <style>
    div#zoom{
      cursor: crosshair;
    }
  </style>
</head>
<body>
    <div id="gzoomwrap">
        <div id="zoom" class="zoom minizoompan">
            <span class="loader">loading...</span>
            <img src='img/myImage.png'/>
        </div>
        <!-- START gzoom zoom bar -->
        <div class="ui-icon ui-icon-circle-minus gzoombutton">&nbsp;</div>
        <div class="gzoomSlider ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all" style="width: 258px;"><a href="#" class="ui-slider-handle ui-state-default ui-corner-all"></a></div>
        <div class="ui-icon ui-icon-circle-plus gzoombutton">&nbsp;</div>
        <br style="clear:both">
        <!-- END gzoom zoom bar -->
    </div>

    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <!-- START gzoom dependencies -->
    <script type="text/javascript" src="js/ui.core.min.js"></script>
    <script type="text/javascript" src="js/ui.slider.min.js"></script>
    <script type="text/javascript" src="js/jquery.gzoom.js"></script>
    <script type="text/javascript" src="js/jquery.mousewheel.js"></script>
    <script type="text/javascript">
      /*<![CDATA[*/
      $(function() {
        $zoom = $("#zoom").gzoom({
            sW: 300,
            sH: 225,
            lW: 1400,
            lH: 1050,
            lighbox : false
        });
      });
      /*]]>*/
    </script>
    <!-- END gzoom dependencies -->
</body>
</html>

我在Chrome控制台上查看了一下,发现库中有一些错误.因此,我认为我没有正确实现 gzoom . (并非在所有浏览器中都可用)

I looked on the Chrome console, and found some errors in the libraries. So I assume I didn't implement gzoom correctly. (Doesn't work in all browsers)

如果您知道我在做什么错...我将非常感谢您!

If you know what I'm doing wrong... I'll thank you a lot !

推荐答案

我是gzoom插件的作者. 该插件是很久以前开发的,但仍可与新版本的jquery和jquery ui一起使用. 如果您包含现代的jquery版本,则还必须包含现代的jquery-ui. 我刚刚尝试使用此版本的插件,即可完成他的工作:

I'm the gzoom plugin author. The plugin was developed a lot of time ago, but it's still working with new versions of jquery and jquery ui. If you include a modern jquery version you have also to include a modern version of jquery-ui. I've just tried the plugin with this versions and it does his job:

jquery-1.10.2.min.js jquery-ui-1.10.3.custom.min.js

jquery-1.10.2.min.js jquery-ui-1.10.3.custom.min.js

包括此文件,并从中删除ui.core.min和ui.slider.min.

Include this files, and remove the ui.core.min from, and ui.slider.min.

这篇关于jQuery gzoom插件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆