第一次尝试让 jscrollpane 工作,但没有成功!
我试图让 jscrollpane 在一个非常简单的页面上工作,但由于某种原因它不起作用。当我删除 jscrollpane 的脚本时,该图像具有正常的滚动条,但当我包含它时,该图像没有滚动条。我想知道是否有人可以看一下是否有任何明显错误。
谢谢尼克
http://nickharambee.dyndns.org/examples/jscrollpane.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<head>
<!-- styles needed by jScrollPane -->
<link type="text/css" href="jquery.jscrollpane.css" rel="stylesheet" media="all" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<!-- the mousewheel plugin - optional to provide mousewheel support -->
<script type="text/javascript" src="jquery.mousewheel.js"></script>
<!-- the jScrollPane script -->
<script type="text/javascript" src="jquery.jscrollpane.min.js"></script>
<script type="text/javascript">
$(function()
{
$('.scroll-pane').jScrollPane();
});
</script>
<style>
.scroll-pane {
width: 200px;
height: 200px;
overflow: auto;
}
</style>
</head>
<html>
<body>
<div class="scroll-pane"><img src="../files/nancy.jpg"></div>
</body>
</html>
I am trying to get jscrollpane working on a very simple page, but for some reason it is not working. An image which has normal scrollbars when I remove the script for jscrollpane, but which has no scrollbars when I include it. I wonder if someone could have a look and see if there is anything obviously wrong.
Thanks
Nick
http://nickharambee.dyndns.org/examples/jscrollpane.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<head>
<!-- styles needed by jScrollPane -->
<link type="text/css" href="jquery.jscrollpane.css" rel="stylesheet" media="all" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<!-- the mousewheel plugin - optional to provide mousewheel support -->
<script type="text/javascript" src="jquery.mousewheel.js"></script>
<!-- the jScrollPane script -->
<script type="text/javascript" src="jquery.jscrollpane.min.js"></script>
<script type="text/javascript">
$(function()
{
$('.scroll-pane').jScrollPane();
});
</script>
<style>
.scroll-pane {
width: 200px;
height: 200px;
overflow: auto;
}
</style>
</head>
<html>
<body>
<div class="scroll-pane"><img src="../files/nancy.jpg"></div>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的
jscrollpane
脚本标记正在加载吗?确保您指向的文件确实存在。如果您的浏览器带有 Javascript 控制台(例如 Safari、Chrome 或带有 Firebug 的 Firefox),那么您可以输入
$('.scroll-pane').jScrollPane
,如果是undefined
那么库无法正确加载。Is your
jscrollpane
script tag loading? Be sure that the file you're pointing at is actually there.If you have a browser with a Javascript Console (e.g., Safari, Chrome, or Firefox w/ Firebug) then you can type
$('.scroll-pane').jScrollPane
and if that isundefined
then the library isn't loading properly.