Want more features on Pastebin? Sign Up, it's FREE!

Tabbed Sidebar Widgets jQuery Fix

By: skapator on Jun 13th, 2012  |  syntax: jQuery  |  size: 1.16 KB  |  views: 300  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jQuery(document).ready( function () {
  2.     jQuery( '.widget_tabs .widgettitle' ).remove();
  3.    
  4.     $_tab_titles = jQuery( '.widget_tabs .tab-title' );
  5.    
  6.     var s = '<h2 class = "widgettitle">';
  7.    
  8.     for ( var k = 0; k < $_tab_titles.size(); k++ ) {
  9.         var title = jQuery( $_tab_titles.get( k ) ).html();
  10.         jQuery( $_tab_titles.get( k ) ).remove();
  11.         s += '<a href = "#" class = "tab-title"><span>' + title + '</span></a>';
  12.     }
  13.    
  14.     s += '</h2>';
  15.    
  16.     jQuery( '.widget_tabs' ).prepend( s );
  17.    
  18.     jQuery( '#tabbed-sidebar-widgets .widgettitle a:first-child' ).addClass('first');
  19.  
  20.     jQuery( '#tabbed-sidebar-widgets .widgettitle a:last-child' ).addClass('last');
  21.  
  22.     jQuery( '.widget ul li:last-child' ).addClass('last');
  23.    
  24.     jQuery( '#tabbed-sidebar-widgets' ).slideshow({
  25.         slide: '.tab-content',
  26.         navigation: 'a.tab-title',
  27.         navigationSelectedClass: 'selected',
  28.         slideshow: false,
  29.         slideshowSpeed: 5000,
  30.         startFromIndex: 1,
  31.         transition: 'fade',
  32.         transitionSpeed: 0,
  33.         mouseOverFreeze: true,
  34.         resizeMode: 'maxHeight'
  35.     });
  36.    
  37. });
clone this paste RAW Paste Data