jquery插件jquery.nicescroll實(shí)現(xiàn)圖片無滾動條左右拖拽的方法
本文實(shí)例講述了jquery插件jquery.nicescroll實(shí)現(xiàn)圖片無滾動條左右拖拽的方法。分享給大家供大家參考。具體如下:
這里介紹jQuery圖片左右拖拽特效,無滾動條,將多張圖片組合在一起形成的效果,插件使用的是jquery.nicescroll.js,拖動過程中不會出現(xiàn)滾動條,這樣更美觀了一些,若需要此效果,可參見下邊框中的代碼。
運(yùn)行效果截圖如下:

具體代碼如下:
<!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>
<title>jquery.nicescroll無滾動條左右拖拽</title>
<style>
*{ margin:0; padding:0; list-style:none;}
img{ border:none;}
#boxscroll {height: 313px;width: 900px;margin:0 auto;overflow: auto;}
#boxscroll div {width:12570px;}
#boxscroll div img {float:left;}
.row {background:#FFFFCC;}
.row2 {background:#66CCFF;}
</style>
<script src="jquery-1.6.2.min.js"></script>
<script src="http://xiazai.jb51.net/201508/yuanma/jquery.nicescroll.js"></script>
<script>
$(document).ready(function() {
var nicesx = $("#boxscroll").niceScroll("#boxscroll div",{touchbehavior:true,cursorcolor:"#FF00FF",cursoropacitymax:0.6,cursorwidth:24,usetransition:true,hwacceleration:true,autohidemode:"hidden"});
});
</script>
</head>
<body>
<div id="boxscroll">
<div>
<img src="http://img.jbzj.com/file_images/article/201508/2015810124458663.jpg" width="1257" height="313" onmousedown="return false" />
<img src="http://img.jbzj.com/file_images/article/201508/2015810124458663.jpg" width="1257" height="313" onmousedown="return false" />
<img src="http://img.jbzj.com/file_images/article/201508/2015810124458663.jpg" width="1257" height="313" onmousedown="return false" />
<img src="http://img.jbzj.com/file_images/article/201508/2015810124458663.jpg" width="1257" height="313" onmousedown="return false" />
<img src="http://img.jbzj.com/file_images/article/201508/2015810124458663.jpg" width="1257" height="313" onmousedown="return false" />
<img src="http://img.jbzj.com/file_images/article/201508/2015810124458663.jpg" width="1257" height="313" onmousedown="return false" />
</div>
</div>
</div>
</body>
</html>
希望本文所述對大家的jquery程序設(shè)計有所幫助。
相關(guān)文章
Jquery:ajax實(shí)現(xiàn)翻頁無刷新功能代碼
ajax實(shí)現(xiàn)翻頁在實(shí)際應(yīng)用中還是比較常見的,實(shí)現(xiàn)ajax翻頁有兩部分:js部分、html部分,具體如下,感興趣的朋友可以參考下,希望對大家有所幫助2013-08-08
jQuery實(shí)現(xiàn)為圖片添加鏡頭放大效果的方法
這篇文章主要介紹了jQuery實(shí)現(xiàn)為圖片添加鏡頭放大效果的方法,提供了四種放大鏡效果供大家選擇使用,并附有完整的源碼下載地址,需要的朋友可以參考下2015-06-06
利用JQuery動畫制作滑動菜單項(xiàng)效果實(shí)現(xiàn)步驟及代碼
滑動菜單項(xiàng)效果,聽起來就是很時尚的一個效果,不過實(shí)現(xiàn)起來有些麻煩,還好有本文的出現(xiàn),可以幫助你解決這個困惑,熱愛特效的你可不要錯過了哈,好了話不多說切入正文2013-02-02
jquery 獲取dom固定元素 添加樣式的簡單實(shí)例
本篇文章主要是對jquery獲取dom固定元素 添加樣式的簡單實(shí)例進(jìn)行了介紹,需要的朋友可以過來參考下,希望對大家有所幫助2014-02-02

