Guest User

Untitled

a guest
Jul 13th, 2011
5,214
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function($) {
  2. $(document).ready( function() {
  3. $('.feature-slider a').click(function(e) {
  4. $('.featured-posts section.featured-post').css({
  5. opacity: 0,
  6. visibility: 'hidden'
  7. });
  8. $(this.hash).css({
  9. opacity: 1,
  10. visibility: 'visible'
  11. });
  12. $('.feature-slider a').removeClass('active');
  13. $(this).addClass('active');
  14. e.preventDefault();
  15. });
  16. });
  17. var current=1;
  18. function autoAdvance(){
  19. if(current==-1) return false;
  20. $('.feature-slider a').eq(current%$('.feature-slider a').length).trigger('click',[true]); // [true] will be passed as the keepScroll parameter of the click function on line 28
  21. current++;
  22. }
  23. // The number of seconds that the slider will auto-advance in:
  24. var changeEvery = 10;
  25. var itvl = setInterval(function(){autoAdvance()},changeEvery*1000);
  26. })(jQuery);
RAW Paste Data