我在实现一个水平滚动的jquery插件时遇到了麻烦。问题是,它不会滚动水平,即使我遵循每条指令。
以下是演示: http://www.designedbyaturtle.co.uk/demos/horizontal-scrolling/
有人可以帮助我
<!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>
答案 0 :(得分:2)
答案 1 :(得分: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>