使用jQuery UI来播放内容而不是淡出?

时间:2012-10-18 19:06:44

标签: jquery jquery-ui

首先,我想道歉没有公开演示,也不是jQuery的新手。

目前有一个非常基本的jQuery“滑块”脚本,可以为刚刚分层的新内容触发fadeIn(据我所知)。我试图使用缓动将此效果更改为幻灯片效果,并包含jQueryUI(目前未包含)。

这是代码

<script type="text/javascript">
var current_featured = 1;
var current_featured_index = 100;
var featured_interval_time = 4000;
var featured_interval = setInterval("advance_featured()", featured_interval_time);

function advance_featured() {
    featured = current_featured + 1;
    if (featured > 4) {
        featured = 1;    
    }
    switch_featured(featured);
}

function switch_featured(featured) {
    current_featured = featured;
    current_featured_index += 10;
    $(".home-featured-post-link").css( { "z-index" : current_featured_index + 10 } );
    $("#home-featured-post-" + current_featured).css( { "z-index" : current_featured_index, "display" : "none" } ).fadeIn();
}

$("#home-featured").hover(
    function() { clearInterval(featured_interval); },
    function() { featured_interval = setInterval("advance_featured()", featured_interval_time); });
</script>

目前它正在旋转四个基本块。我并没有尝试做任何事情,只是将动画从淡入淡出效果更改为滑动动画。我想在新块中滑动时滑出旧块,但这不是必需的。我试图让改变变得简单。

谢谢,

0 个答案:

没有答案