0

我在实现水平滚动的 jquery 插件时遇到了麻烦。问题是,即使我遵循了每条指令,它也不会水平滚动。

这是演示: http ://www.designbyaturtle.co.uk/demos/horizo​​ntal-scrolling/

我的演示 http://jsbin.com/ezizoz/1

有人能帮我吗

  <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

  <html>
  <head>


  <script src="http://www.designedbyaturtle.co.uk/demos/horizontal-scrolling/jquery.mousewheel.min.js"></script>    <meta charset="utf-8" />

  <script type = "text/javascript" src ="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>


  <script>
        $(document).ready(function() {

            $('html, body, *').mousewheel(function(e, delta) {
                this.scrollLeft -= (delta * 40);
                e.preventDefault();
            });

        });
    </script>

  </head>

  <body>

  dwdddddddddddddddddddddddddddddddddddd
  dwdddddddddddddddddddddddddddddddddddddwdddddddddddddddddddddddddddddddddddddwdddddddddddddddddddddddddddddddddddddwdddddddddddddddddddddddddddddddddddddwdddddddddddddddddddddddddddddddddddddwdddddddddddddddddddddddddddddddddddddwdddddddddddddddddddddddddddddddddddddwdddddddddddddddddddddddddddddddddddddwdddddddddddddddddddddddddddddddddddd
  </body>
  </html>
4

2 回答 2

2

你也必须包括CSS ..

然后它工作

http://jsbin.com/ezizoz/4

检查这个演示

于 2013-05-08T10:59:14.947 回答
0

它正在工作。只需交换脚本行。首先包括 jquery 文件,然后是 mousewheel 文件。

<meta charset="utf-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://www.designedbyaturtle.co.uk/demos/horizontal-scrolling/jquery.mousewheel.min.js"></script>  
于 2013-05-08T10:54:44.920 回答