所属分类:幻灯片和轮播图

JQUERY多变的幻灯片-COOLCAROUSELS-做中右切换

33225 浏览 321 收藏 4 留言
ie兼容6

插件描述

CoolCarousels集合了多种模式的幻灯片,每种模式都有不同德样式和外观,基于jQuery库构建而成。有带有缩略图导航的幻灯片,有包含动态项的旋转木马等等,你基本上可以在这里找到所有类型的幻灯片。到目前为止,CoolCarousels一共有65种类型,那么接下来我就挑选其中的一些来讲解。

更新时间
2015-07-06 17:26
下载量
1961
所需 JQ 币
0
分类
媒体 / 幻灯片和轮播图

详细内容

CoolCarousels集合了多种模式的幻灯片,每种模式都有不同德样式和外观,基于jQuery库构建而成。有带有缩略图导航的幻灯片,有包含动态项的旋转木马等等,你基本上可以在这里找到所有类型的幻灯片。到目前为止,CoolCarousels一共有65种类型,那么接下来我就挑选其中的一些来讲解。


使用步骤

1、引入以下的js和css文件

<script src="http://code.jquery.com/jquery-1.8.2.min.js"type="text/javascript"></script>
<script src="jquery.carouFredSel-6.2.0-packed.js" type="text/javascript"></script>


2、在head标签中加入以下js代码

<script type="text/javascript">
$(function() {
    var $l = $('#carousel-left'),
        $c = $('#carousel-center'),
        $r = $('#carousel-right');
                     
    $l.carouFredSel({
        auto: false,
        items: 1,
        direction: 'right',
        prev: {
            button: '#prev',
            fx: 'uncover',
            onBefore: function() {
                setTimeout(function() {
                    $c.trigger( 'prev' );
                }, 100);
            }
        },
        next: {
            fx: 'cover'
        }
    });
    $c.carouFredSel({
        auto: false,
        items: 1,
        prev: {
            onBefore: function() {
                setTimeout(function() {
                    $r.trigger( 'prev' );
                }, 100);
            }
        },
        next: {
            onBefore: function() {
                setTimeout(function() {
                    $l.trigger( 'next' );
                }, 100);
            }
        }
    });
    $r.carouFredSel({
        auto: false,
        items: 1,
        prev: {
            fx: 'cover'
        },
        next: {
            button: '#next',
            fx: 'uncover',
            onBefore: function() {
                setTimeout(function() {
                    $c.trigger( 'next' );
                }, 100);
            }
        }
    });
});
</script>


3、在body标签中加入幻灯片整个外部div容器的html代码。
div #carousel-left 是幻灯片左边的容器
div #carousel-center 是幻灯片中间的容器
div #carousel-right 是幻灯片右边的容器

<div id="wrapper">
     
    <div id="carousel-left">
        <img src="img/rally4.jpg" width="450" height="325"> <imgsrc="img/rally1.jpg" width="450" height="325"> <img src="img/rally2.jpg"width="450" height="325"> <img src="img/rally3.jpg" width="450" height="325">
    </div>
 
    <div id="carousel-center">
        <img src="img/rally1.jpg" width="550" height="400"> <imgsrc="img/rally2.jpg" width="550" height="400"> <img src="img/rally3.jpg"width="550" height="400"> <img src="img/rally4.jpg" width="550" height="400">
    </div>
 
    <div id="carousel-right">
        <img src="img/rally2.jpg" width="450" height="325"> <imgsrc="img/rally3.jpg" width="450" height="325"> <img src="img/rally4.jpg"width="450" height="325"> <img src="img/rally1.jpg" width="450" height="325">
    </div>
<a id="prev" href="#">?</a> <a id="next" href="#">?</a>
</div>


当然还牵涉到一些css样式,我在这就不写出来了,大家可以查看源码中的 Demo.


参数配置

CoolCarousels的调用js代码我已经在上面写出来了,所以可以配置的参数就从里面找了,无非就是幻灯片播放速度之类的参数,大家自行配制吧。


关键词:JQUERY幻灯片COOLCAROUSELS

讨论这个项目 (4)

不可不戒

正常...

大圣
网盘链接失效噢。
插件王子

刚测试过,网盘正常可以下载的。

hacker

网盘链接失效了哦

当前页面为只读展示,仅显示已审核留言;提交留言功能暂未开放。