jQuery JScrollPane因某些原因无法正常工作

时间:2011-03-22 16:12:10

标签: jquery jscrollpane

我已经复制了线的演示线,对我来说发生的事情是内容加载然后滚动条消失了。

我知道正在调用和应用jScrollPane函数,因为当内容加载时滚动条消失但是对于我的生活我无法弄清楚为什么......

任何人都有使用此插件的经验吗?

<!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 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>

1 个答案:

答案 0 :(得分:1)

我重新创建了代码here,并在添加CSS链接时开始工作。您的代码中的CSS链接托管在您的服务器上,因此我无法自己查看,但我会检查该文件是否在该URL上可用并且它是正确的文件。

我从jScrollPane的第1版获得了CSS链接,以防万一。

你也错过了一个关闭/ div的价值。

编辑:This是我要链接到上面的内容。很抱歉造成任何混乱。