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'); // // var $sibs = $active.siblings(); // var rndNum = Math.floor(Math.random() * $sibs.length ); // var $next = $( $sibs[ rndNum ] ); $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()", 2000 ); }); (function($) { $(document).ready(function() { // function leftMove() { var docHeight = $(document).innerHeight(); var container = $('div.wrap_default'); var init_top = container.offset().top; var containerTop = container.innerHeight() + init_top; var scrollTop; $(window).scroll(function() { scrollTop = $(window).scrollTop(); if(docHeight <= containerTop + scrollTop) scrollTop = docHeight - containerTop; container.css({marginTop: scrollTop}); }); } //$(window).load(leftMove); // $('#scroll_top').click(function(e) { $('body, html').stop().animate({scrollTop:0}, 500); e.preventDefault(); }); var scrollTimer = null; $(window).scroll(function(e) { clearTimeout(scrollTimer); scrollTimer = setTimeout(function() { var scrollTop = $(window).scrollTop(); if(scrollTop > 100) $('#scroll_top').fadeIn(600); else $('#scroll_top').fadeOut(200); }, 100); }); }); }(jQuery));