2010-06-16 4 views

Répondre

2

problème est dans:

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

Vous passez à la première élément, évitez de l'afficher, puis passez à la suivante.

changement à ce qui suit:

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(); 
    } 

également fixé sur le bouton précédent. Voir à: http://jsbin.com/esame4/6/

Modifié une fois de plus ;. Fait plus uniforme partout.

+0

+1 merci à vous aussi :) – Sarfraz

+0

Mervyn, je dois admettre que vous avez mieux expliqué votre solution, même si elle a du code redondant :) – MvanGeest

Questions connexes