jQuery(document).ready(function($) { /*---------------------------------------------------------------------------* * Scroll to top /*---------------------------------------------------------------------------*/ $('#footer a.top,.sc-divider a').click(function() { $('html, body').animate({scrollTop:0},'slow'); return false; }); /*---------------------------------------------------------------------------* * Background switch /*---------------------------------------------------------------------------*/ if($('#headstyle-switch').length) { $('#headstyle-switch a').click(function(e) { e.preventDefault(); // Remove active class $('#headstyle-switch a').removeClass('active'); // Set class to active $(this).addClass('active'); // Get image attributes image = $(this).attr('data-image'); repeat = $(this).attr('data-repeat'); size = $(this).attr('data-size'); // Update background image $('#headstyle-bg div.image').css({ 'background-image' : 'url(' + image + ')', 'background-repeat' : repeat, 'background-size' : size }); // Set cookie $.cookie('_bandit_header',$(this).parent().index(),{expires: 365, path: '/'}); }); } /*---------------------------------------------------------------------------* * Add alt-row styling to tables /*---------------------------------------------------------------------------*/ if($('.entry table').length) { $('.entry table tr:odd').addClass('alt-table-row'); } /*---------------------------------------------------------------------------* * jQuery UI Tabs /*---------------------------------------------------------------------------*/ // widget tabs if($('.widget_bandit_tabs').length) { $('.bandit-tabs').tabs({ fx: {opacity:'show'} }); } // content tabs if($('.sc-tabs').length) { $('.sc-tabs').tabs({ fx: {opacity:'show'} }); } /*---------------------------------------------------------------------------* * Toggle Box /*---------------------------------------------------------------------------*/ if($('.toggle-box').length) { $('h4.toggle-title').click(function() { $(this).toggleClass('toggle-title-active') $(this).parent().find('.toggle-inner').toggle(); return false; }); } });