Created
April 11, 2011 17:49
-
-
Save farnhizzle/913931 to your computer and use it in GitHub Desktop.
This is a work in progress of a standard tab switcher function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if($('#payment-picker').length > 0) { | |
$('.discount-form').persistentPanel({ | |
toggler: 'div.discounts h3 .toggle', | |
togglerContents: false, | |
togglerClass: {open: 'up', closed: 'down'}, | |
cookieName: 'discountForm' | |
}); | |
// transfer click on h3 to toggler for pP */ | |
$('div.discounts h3').click(function(){$(this).find('div.toggle').click();}); | |
// wtf mate? this only works if its WITH the usage | |
$.fn.toggleTabMenu = function(kickoff) { | |
this.find('ul li a').live('click', function(e){ | |
$(this).closest('ul').find('a').removeClass('current'); | |
$(this).addClass('current'); | |
$(this).closest('div').find('> div').hide(); | |
$('#' + $(this).attr('data-show-div')).show(); | |
e.preventDefault(); | |
}); | |
kickoff.call(this); | |
return this; | |
}; | |
$('#payment-picker').toggleTabMenu(function(){$(this).find('#credit-card-link').click()}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment