![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 33 Pomógł: 1 Dołączył: 8.05.2010 Ostrzeżenie: (0%) ![]() ![]() |
witam
mam pewien problem z ktorym nie potrafie sobie poradzic, chcialem zastosowac pokaz slajdów na stronie uzywajac kodu z http://blog.projektowanie-stron.szczecin.p...lideshowjquery/ Problem tkwi w tym że $active jest rowna 0 i skrypt nie jest wykonywany, tak jakby nie znajdowalo tego biektu w modelu dom. oto kod: html: <div id="slideshow"> <img src="../images/1.jpg" alt="" class="active" id="one" /> <img src="../images/2.jpg" alt="" /> <img src="../images/3.jpg" alt="" /> </div> css: #slideshow { position:relative; height:120px;width:700px } #slideshow IMG { position:absolute; top:0; left:0; z-index:8;height:120px;width:700px } #slideshow IMG.active { z-index:10; } #slideshow IMG.last-active { z-index:9; } js: $(document).ready(function() { setInterval( "slideSwitch()", 5000 ); }); 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'); }); } |
|
|
![]() ![]() |
![]() |
Aktualny czas: 19.08.2025 - 08:42 |