开发者

jQuery ScrollPane just not working for some reason

开发者 https://www.devze.com 2023-02-18 05:48 出处:网络
I\'ve copied the demo line for line and what happens for me is that the content loads and then the scroll bar just disappears.

I've copied the demo line for line and what happens for me is that the content loads and then the scroll bar just disappears.

I know the jScrollPane function is being called and applied because the scroll bar disappears when the content loads but for the life of me I can't figure out why...

Anyone have any experience with this plug-in?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
<link type="text/css" href="/_assets/js/jquery.jscrollpane.css" rel="stylesheet" media="all" /> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="/_assets/js/jquery.jscrollpane.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(function()
{
$('.scroll-pane').jScrollPane();
});
</script>   
<div id="container">
<div id="content">
<div class="scroll-pane" style="width:100%;height:100px;overflow:auto;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus aliquet, sapien eget tincidunt fermentum, urna justo rutrum tortor, molestie pharetra dolor leo non velit. Donec sem magna, cursus congue feugiat iaculis, viverra eget sapien. Cras fringilla adipiscing pharetra. Sed semper nisi nec purus vulputate at iaculis enim venenatis. Pellentesque adipiscing, erat laoreet euismod semper, metus magna rutrum orci, nec convallis leo dolor vitae sem. Nunc malesuada consequat blandit. Sed sed urna sed arcu porttitor semper sed molestie dui. Sed sed dolor 开发者_C百科nibh. Aenean a metus est. Maecenas quam felis fringilla nec rhoncus vel, interdum eu mauris. Nulla sapien tellus, condimentum nec blandit sed, laoreet ac dui. Vestibulum vitae odio eget libero facilisis venenatis et eget justo. Aliquam velit ligula, cursus sed imperdiet vel, convallis ac urna. Maecenas quis eros ante. Pellentesque blandit enim suscipit purus vestibulum tempor vulputate leo sollicitudin. Nunc viverra lacus vel urna scelerisque sed tempor tortor congue. Suspendisse aliquam aliquam convallis. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
<br /><br />
Vivamus sit amet sapien lacus. Aliquam id augue eget neque dictum ultricies vitae sit amet lacus. Sed tempus pulvinar ullamcorper. Nunc fringilla tincidunt justo vel imperdiet. Morbi aliquam eleifend aliquet. Sed id sagittis purus. Morbi sem dui, feugiat a posuere non, tincidunt sit amet dolor. Nullam tristique dolor ut dui convallis id egestas eros tincidunt. Mauris a orci sit amet nisi viverra convallis quis quis mi. In id ligula quis justo facilisis pellentesque eu in metus. 
</div>
</body>
</html>


I've recreated your code here and it started working when I added the CSS link. The CSS link in your code is hosted on your server so I can't see for myself, but I would check that the file is available at that url and that it is the correct file.

I got the CSS link from version 1 of jScrollPane, in case that matters.

You're also missing a closing /div for what it's worth.

Edit: This is what I meant to link to above. Sorry for any confusion caused.

0

精彩评论

暂无评论...
验证码 换一张
取 消