Autor | Zpráva | ||
---|---|---|---|
Deryk Profil * |
#1 · Zasláno: 21. 9. 2011, 14:26:45
Ahoj,
mám následující script: function slideSwitch() { var $active = $('#slideshow IMG.active'); if ( $active.length == 0 ) $active = $('#slideshow IMG:last'); var $next = $active.next().length ? $active.next() : $('#slideshow IMG:first'); $active.addClass('last-active'); $next.css({opacity: 0.0}) .addClass('active') .animate({opacity: 1.0}, 1000, function() { $active.removeClass('active last-active'); }); } $(function() { setInterval( "slideSwitch()", 5000 ); }); <div id="slideshow"> <img src="images/slider1.png" alt="" class="active" /> <img src="images/slider2.png" alt="" class="" /> <img src="images/slider3.png" alt="" class="" /> </div> <div id="slider_nav"> <a href="#" class="current"></a> <a href="#" class=""></a> <a href="#" class=""></a> </div> Potřeboval bych zde zapracovat, aby se mi společně se změnou class u img, změnila i class u odkazu na current. Nedaří se mi to sem zakomponovat, můžete mi prosím poradit? Díky moc |
||
Darker Profil |
#2 · Zasláno: 23. 9. 2011, 21:45:45
No kdybys pouzival DOM, mohl bych ti to rict konkretne. Takhle ti akorat muzu rict ze musis zjistit, kolikaty je IMG element a podle toho ziskat tolikaty A.
|
||
Časová prodleva: 14 let
|
0