2010-06-16 23 views

回答

2

问题修正了先前的功能也被:

if ($($curbox).next().attr('class') === 'box') 
    { 
     $('#content_navigator .box').hide(); 
     $($curbox).next().fadeIn(1000); 
     $curbox = $($curbox).next(); 
    } 
else 
    { 
     $curbox = ('#content_navigator .box:first'); 
    } 

您切换到第一元素,避免显示它,然后移动到下一个。

更改为以下:

if ($($curbox).next().attr('class') === 'box') 
    { 
     $('#content_navigator .box').hide(); 
     $($curbox).next().fadeIn(1000); 
     $curbox = $($curbox).next(); 
    } 
else 
    { 
     $('#content_navigator .box').hide(); 
     $('#content_navigator .box:first').fadeIn(1000); 
     $curbox = $('#content_navigator .box:first').next(); 
    } 

而且固定的一个按钮。请参阅:http://jsbin.com/esame4/6/

再次改变;整个过程更加统一。

+0

+1谢谢你太:) – Sarfraz 2010-06-16 18:11:39

+0

默文,我必须承认你更好地解释你的解决方案,虽然它有一些冗余的代码:) – MvanGeest 2010-06-16 18:34:44