2012-09-01 159 views
1

我正在创建一个滑块,它与zurb的轨道滑块一起运行。在这个问题的关键是,我要控制两个幻灯片有一组导航箭头......这里就是我加入到orbit.next功能:带箭头的滑块

$('.description > p:visible') 
    .fadeOut(500) 
    .next() 
    .fadeIn(500) 
    .end() 
    .appendTo('.description'); 

这是下一个箭头的代码,但我怎样才能调整这个代码,使它适用于以前的箭头?

感谢

回答

0

我真的不知道轨道滑块,但我想我能以某种方式帮助,这是我得到目前为止

$('.description p:last-fo-type') 
    .fadeOut(500) 
    .prev() 
    .fadeIn(500) 
    .end() 
    .prependTo('.description'); 

如果我误解了什么,请让我知道。所以我可以做必要的更正。

祝你好运。

0

我甲肝想通了......

this.$element.bind('orbit.next', function() { 
    self.shift('next'); 

    if ($('.description > p:visible').is(':not(:last-of-type)')) { 
     $('.description > p:visible').fadeOut(500).next().fadeIn(500); 
    } else { 
     $('.description > p:visible').fadeOut(500); 
     $('.description > p:first').fadeIn(500); 
    } 
    }); 

    this.$element.bind('orbit.prev', function() { 
    self.shift('prev'); 
    if ($('.description > p:visible').is(':not(:first-of-type)')) { 
     $('.description > p:visible').fadeOut(500).prev().fadeIn(500); 
    } else { 
     $('.description > p:visible').fadeOut(500); 
     $('.description > p:last').fadeIn(500); 
    } 
    });