trying to get jscrollpane working for the first time, without success!
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>
Is your jscrollpane
script tag loading? Be sure that the file you're pointing at is actually there.
<script type="text/javascript" src="jquery.jscrollpane.min.js"></script>
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 is undefined
then the library isn't loading properly.
精彩评论