图片轮播效果

来源:互联网 发布:java微信开发教程csdn 编辑:程序博客网 时间:2024/05/11 22:52

使用方法:

$(function () {
//渐隐效果轮播
    var fadeConfig = {
        stayTime: 2000,
        actionTime: 1000,
        wrap: $('#rotateFade .rotate-wape'),
        nvs: $('#rotateFade .rotate-nav a'),
        items: $('#rotateFade .rotate-item'),
        width: 700,
        effect: 'fade'
    };
    var fadeRotate = new Rotate(fadeConfig);
    $('#rotateFade .rotate-nav a').click(function () {
        if (!$(this).is('.active')) {
            var index = $('#rotateFade .rotate-nav a').index($(this));
            fadeRotate.custom(index);
        }
    });
    
//平滑效果轮播
    var moveConfig = {
        stayTime: 2000,
        actionTime: 1000,
        wrap: $('#rotateMove .rotate-wape'),
        nvs: $('#rotateMove .rotate-nav a'),
        items: $('#rotateMove .rotate-item'),
        width: 700
    };
    var moveRotate = new Rotate(moveConfig);
    $('#rotateMove .rotate-nav a').click(function () {
        if (!$(this).is('.active')) {
            var index = $('#rotateMove .rotate-nav a').index($(this));
            moveRotate.custom(index);
        }
    });
});

0 0
原创粉丝点击