Home > Article > Web Front-end > jquery plug-in jquery.nicescroll method to realize left and right dragging of pictures without scroll bar_jquery
The example in this article describes the method of jquery plug-in jquery.nicescroll to realize left and right dragging of images without scroll bars. Share it with everyone for your reference. The details are as follows:
Here we introduce the special effect of dragging left and right pictures with jQuery without scroll bars. The effect is formed by combining multiple pictures together. The plug-in uses jquery.nicescroll.js. No scroll bars will appear during the dragging process, which is more beautiful. If you need this effect, please see the code in the box below.
The screenshot of the running effect is as follows:
The specific code is as follows:
<!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://files.jb51.net/file_images/article/201508/2015810124458663.jpg" width="1257" height="313" onmousedown="return false" /> <img src="http://files.jb51.net/file_images/article/201508/2015810124458663.jpg" width="1257" height="313" onmousedown="return false" /> <img src="http://files.jb51.net/file_images/article/201508/2015810124458663.jpg" width="1257" height="313" onmousedown="return false" /> <img src="http://files.jb51.net/file_images/article/201508/2015810124458663.jpg" width="1257" height="313" onmousedown="return false" /> <img src="http://files.jb51.net/file_images/article/201508/2015810124458663.jpg" width="1257" height="313" onmousedown="return false" /> <img src="http://files.jb51.net/file_images/article/201508/2015810124458663.jpg" width="1257" height="313" onmousedown="return false" /> </div> </div> </div> </body> </html>
I hope this article will be helpful to everyone’s jquery programming design.