1 Replies - 536 Views - Last Post: 22 March 2012 - 11:18 AM

#1 Alekhoff  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-March 12

Jquery slideshow problem

Posted 20 March 2012 - 04:55 AM

Hey guys,

I'm kind of a noob when it comes to jquery, so my problem is that i cant get this simple slider to work on jQuery 1.7.1 (newest) Anyway if some of you pros can take a lokk at it for me and see whats wrong, I would be very happy!
I think the problems is within the last function: setInterval(function(){



$(document).ready(
	  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');
	          });
	  }
	  
	  setInterval(function() {
	  	
	  	slideSwitch();
	  
	  }, 5000 );
	  
	  );



Is This A Good Question/Topic? 0
  • +

Replies To: Jquery slideshow problem

#2 enjoibp3  Icon User is offline

  • New D.I.C Head

Reputation: 14
  • View blog
  • Posts: 48
  • Joined: 02-March 11

Re: Jquery slideshow problem

Posted 22 March 2012 - 11:18 AM

I believe all it is, is you're missing the function from document.ready.

Should be:
$(document).ready(function(){
    function slideshow(){
    }
    setInterval(function(){
        slideshow();
    }, 5000);
});


This post has been edited by enjoibp3: 22 March 2012 - 11:22 AM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1