Answer the question
In order to leave comments, you need to log in
Why doesn't slide show jquery work?
Hello.
Is there a code for the slideshow?
function slideSwitch() {<br/>
var $active = $('#slideshow DIV.active');<br/>
<br/>
if ( $active.length == 0 ) $active = $('#slideshow DIV:last');<br/>
<br/>
var $next = $active.next().length ? $active.next()<br/>
: $('#slideshow DIV:first');<br/>
<br/>
$active.addClass('last-active');<br/>
<br/>
$next.css({opacity: 0.0})<br/>
.addClass('active')<br/>
.animate({opacity: 1.0}, 1000, function() {<br/>
$active.removeClass('active last-active');<br/>
});<br/>
}<br/>
<br/>
$(function() {<br/>
setInterval( "slideSwitch()", 5000 );<br/>
});<br/>
<-div id="slideshow" align="center"><br/>
<-div class="active"><br/>
<-a href="/test1.html"><-img src="/images/images1.jpg" alt="" class="active" /><-/a><br/>
<-/div><br/>
<-div><br/>
<-a href="/test2.html"><-img src="/images/images2.jpg" alt="" /><-/a><br/>
<-/div><br/>
<-/div><br/>
<-script type="text/javascript" src="/js/jquery-1.6.2.min.js"><-/script>"
Answer the question
In order to leave comments, you need to log in
Is this jquery.js connected by any chance after the Slide Show?
Give an example page or copy errors from the console if any.
PS cache the elements
setInterval( "slideSwitch()", 5000 ); // и никогда так не делайте
setInterval(slideSwitch, 5000 ); // вот так намного лучше
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question