jquery自定义滚动条插件示例分享自定义滚动条插件示例分享
主要介绍了jquery自定义滚动条插件示例,需要的朋友可以参考下
复制代码 代码如下:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>自定义滚动条插件</title>
<style type="text/css">
<!--
html,body{height:100%;}
body {margin:0; padding:0; background:#111 url(mcs_demo_bg.jpg) no-repeat; min-width:1100px; min-height:940px;}
a:link,a:visited,a:hover{color:#C30;}
.info{position:absolute; left:40px; top:20px; width:260px; color:#CCC; font-family:"Lobster",Arial, Helvetica, sans-serif; font-
size:18px; padding:5px;}
.info .big{font-size:34px;}
.postURL{position:absolute; top:20px; right:20px; display:block; width:100px; height:100px;
background:url(plugin_homepage.png) no-repeat; z-index:10;}
.blue{color:#09C;}
h1{padding:10px 5px; margin:10px 0; color:#fff; font-family:"Yanone Kaffeesatz", Georgia, "Times New Roman", Times, serif;
font-size:36px; font-weight:normal; line-height:34px;}
h2{font-family:"Lobster",Arial, Helvetica, sans-serif; font-size:22px; font-weight:normal; color:#09C; margin-left:5px;}
h3{font-family:"Lobster",Arial, Helvetica, sans-serif; font-size:26px; font-weight:normal; color:#31231E; margin-left:10px;}
h4{font-family:"Lobster",Arial, Helvetica, sans-serif; font-size:18px; font-weight:normal; color:#C30; margin:5px 10px;}
-->
</style>
<link href="jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery.easing.1.3.js"></script>
<script type="text/javascript" src="jquery.mousewheel.min.js"></script>
</head>
<body>
<div class="info"><span class="blue">malihu </span><br /><span class="big">Custom Scrollbar </span>plugin</div>
<!-- content block -->
<div id="mcs_container">
<div class="customScrollBox">
<div class="container">
<div class="content">
<h1>Adjustable scroller height with easing</h1>
<p><a href="#" onclick="LoadNewContent('mcs_container','dynamic_content.html');return false">Load new content
dynamically</a></p>
<p style="color:#C96;">Aliquam erat volutpat. Maecenas non tortor nulla, non malesuada velit. Nullam felis tellus,
tristique nec egestas in, luctus sed diam. Suspendisse potenti. </p>
<p class="alt"><em>consectetur adipiscing elit. Nulla consectetur libero consectetur quam consequat nec tincidunt
massa feugiat. Donec egestas mi turpis. Fusce adipiscing dui eu metus gravida vel facilisis ligula iaculis. Cras a rhoncus
massa. Donec sed purus eget nunc placerat consequat.</em></p>
<img src="mcsImg1.jpg" />
<p>Aliquam erat volutpat. Maecenas non tortor nulla, non malesuada velit. Nullam felis tellus, tristique nec egestas
in, luctus sed diam. Suspendisse potenti. Cras venenatis condimentum nibh a mollis. Duis id sapien nibh. Vivamus porttitor,
felis quis blandit tincidunt, erat magna scelerisque urna, a faucibus erat nisl eget nisl. Aliquam consequat turpis id velit
egestas a posuere orci semper. Mauris suscipit erat quis urna adipiscing ultricies. In hac habitasse platea dictumst. Nulla
scelerisque lorem quis dui sagittis egestas.</p>
<p class="alt">Etiam sed massa felis, aliquam pellentesque est. Quisque quis ante tortor, sed egestas risus.
Maecenas varius adipiscing nulla, nec rhoncus est mattis id. Aenean blandit convallis nisi at fringilla. Nunc id massa eu
sapien fringilla posuere.</p>
<img src="mcsImg2.jpg" />
<p style="color:#C96;">Nam eu arcu at purus tincidunt pharetra ultrices at ipsum. Mauris urna nunc, vulputate quis
gravida in, pharetra id mauris. Ut sit amet mi dictum nulla lobortis adipiscing quis a nulla. Etiam diam ante, imperdiet vel
scelerisque eget, venenatis non eros. Praesent ipsum sem, eleifend ut gravida eget, tristique id orci. Nam adipiscing, sem in
mattis vulputate, risus libero adipiscing risus, eu molestie mi justo eget nulla.</p>
<p>Cras venenatis metus et urna egestas non laoreet orci rutrum. Pellentesque ullamcorper dictum nisl a