random image + thumbnails
хочу чтобы картинки меняли класс с одинаковой скоростью как и случайный объект эмбед
вот хтмл: <div id="slider_container"> <div id="image2"></div> <div id="thumb2"> <a href="#" rel="/documents/templates/bilgiteknolojileri/standalone.swf" class="image2" ><img title="Standalone DVR" alt="Standalone DVR" class="slider_thumb" src="/documents/templates/bilgiteknolojileri/images/t_flash/t2.png" border="0"/></a> <a href="#" rel="/documents/templates/bilgiteknolojileri/mobil.swf" class="image2"><img title="Mobil DVR" alt="Mobil DVR" class="slider_thumb" src="/documents/templates/bilgiteknolojileri/images/t_flash/t3.png" border="0"/></a> <a href="#" rel="/documents/templates/bilgiteknolojileri/3b2.swf" class="image2"><img title="3 Boyutlu Konumlandirma" alt="3 Boyutlu Konumlandirma" class="slider_thumb" src="/documents/templates/bilgiteknolojileri/images/t_flash/t4.png" border="0"/></a> </div></div> а вот яваскрипт: $(function() { $(".image2").click(function() {var image = $(this).attr("rel"); $('#image2').hide(); $('#image2').fadeIn('slow'); $('#image2').html('<embed height="253" width="440" wmode="transparent" src="' + image + '"></embed>'); var image2 = $('#image2 embed').attr('src'); $("#thumb2 a img").removeClass("open"); $("#thumb2 a[rel='" + image2 + "'] img").addClass("open"); return false; }); }); function random_imglink(){ var myimages=new Array() //specify random images below. You can have as many as you wish myimages[1]="/documents/templates/bilgiteknolojileri/standalone.swf" myimages[2]="/documents/templates/bilgiteknolojileri/mobil.swf" myimages[3]="/documents/templates/bilgiteknolojileri/3b2.swf" var ry=Math.floor(Math.random()*myimages.length) if (ry==0) ry=1 var theFlashElement = '<embed wmode="transparent" src="'+myimages[ry]+'" height="253" width="440"></embed>'; document.getElementById("image2").innerHTML = theFlashElement; } setInterval( "random_imglink()", 2000 ); random_imglink() $(document).ready(function() { var image2 = $('#image2 embed').attr('src'); $("#thumb2 a[rel='" + image2 + "'] img").addClass("open"); }); сейчас флешка меняется, она меняться каждые 2 сек, но класс картинок тоже должен был поменяться, но не поменялся, в чем может быть проблема? вначале класс применяется к картинке, но после 2 сек не меняется, а флеш меняется... |
так в ы нигде и не меняете их класс раз в две секунды
|
Часовой пояс GMT +3, время: 22:01. |