水平旋转木马画廊jquery

时间:2016-04-30 16:36:15

标签: javascript jquery html css gallery

有人可以帮我创建一个水平的carousell画廊吗?代码无法正常工作,需要与31张图片兼容。它需要在一行中格式化,并启用触摸,因此它将水平滚动。它看起来好像是一条长条纸,可以自由地拖到一边或另一边。在onClick时,是否可以全屏显示图库?

HTML

 <ul id="scroller">
   <li><img src="image1.jpg" width="290" height="200"></li>
   <li><img src="image2.jpg" width="290" height="200"></li>
   <li><img src="image3.jpg" width="290" height="200"></li>
   ...
 </ul>

脚本

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<script type="text/javascript" src="jquery.simplyscroll.js"></script>
<link rel="stylesheet" href="jquery.simplyscroll.css" media="all" type="text/css">

<script type="text/javascript">
    (function($) {
        $(function() { //on DOM ready 
            $("#scroller").simplyScroll();
        });
    })(jQuery);
</script>

CSS

/* Container DIV - automatically generated */
.simply-scroll-container { 
    position: relative;
}

/* Clip DIV - automatically generated */
.simply-scroll-clip { 
    position: relative;
    overflow: hidden;
}

/* UL/OL/DIV - the element that simplyScroll is inited on
Class name automatically added to element */
.simply-scroll-list { 
    overflow: hidden;
    margin: 0;
    padding: 0;
    list-style: none;
}

.simply-scroll-list li {
    padding: 0;
    margin: 0;
    list-style: none;
}

.simply-scroll-list li img {
    border: none;
    display: block;
}

/* Custom class modifications - adds to / overrides above

.simply-scroll is default base class */

/* Container DIV */
.simply-scroll { 
    width: 576px;
    height: 200px;
    margin-bottom: 1em;
}

/* Clip DIV */
.simply-scroll .simply-scroll-clip {
    width: 576px;
    height: 200px;
}

/* Explicitly set height/width of each list item */ 
.simply-scroll .simply-scroll-list li {
    float: left; /* Horizontal scroll only */
    width: 290px;
    height: 200px;
}

0 个答案:

没有答案