Created
February 8, 2013 04:23
-
-
Save whyisjake/4736577 to your computer and use it in GitHub Desktop.
Any ideas on how to factor this? I can change the IDs or add data attributes if needed.
This file contains 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
jQuery(document).ready(function(){ | |
jQuery('#link-js-step-1').click(function() { | |
console.log('Clicked'); | |
googletag.pubads().refresh(); | |
_gaq.push(['_trackPageview']); | |
jQuery('#js-step-1').slideDown(); | |
jQuery('#js-step-2').slideUp(); | |
jQuery('#js-step-3').slideUp(); | |
jQuery('#js-step-4').slideUp(); | |
jQuery('#js-step-5').slideUp(); | |
}); | |
jQuery('#link-js-step-2').click(function() { | |
console.log('Clicked'); | |
googletag.pubads().refresh(); | |
_gaq.push(['_trackPageview']); | |
jQuery('#js-step-2').slideDown(); | |
jQuery('#js-step-1').slideUp(); | |
jQuery('#js-step-3').slideUp(); | |
jQuery('#js-step-4').slideUp(); | |
jQuery('#js-step-5').slideUp(); | |
}); | |
jQuery('#link-js-step-3').click(function() { | |
console.log('Clicked'); | |
googletag.pubads().refresh(); | |
_gaq.push(['_trackPageview']); | |
jQuery('#js-step-3').slideDown(); | |
jQuery('#js-step-1').slideUp(); | |
jQuery('#js-step-2').slideUp(); | |
jQuery('#js-step-4').slideUp(); | |
jQuery('#js-step-5').slideUp(); | |
}); | |
jQuery('#link-js-step-4').click(function() { | |
console.log('Clicked'); | |
googletag.pubads().refresh(); | |
_gaq.push(['_trackPageview']); | |
jQuery('#js-step-4').slideDown(); | |
jQuery('#js-step-1').slideUp(); | |
jQuery('#js-step-2').slideUp(); | |
jQuery('#js-step-3').slideUp(); | |
jQuery('#js-step-5').slideUp(); | |
}); | |
jQuery('#link-js-step-5').click(function() { | |
console.log('Clicked'); | |
googletag.pubads().refresh(); | |
_gaq.push(['_trackPageview']); | |
jQuery('#js-step-5').slideDown(); | |
jQuery('#js-step-1').slideUp(); | |
jQuery('#js-step-2').slideUp(); | |
jQuery('#js-step-3').slideUp(); | |
jQuery('#js-step-4').slideUp(); | |
}); | |
}); |
jQuery(document).ready(function(){
jQuery('#tabs div').click(function() {
id = jQuery(this).attr('id');
googletag.pubads().refresh();
_gaq.push(['_trackPageview']);
jQuery('.tab-content div#js-' + id).slideDown();
jQuery('.tab-content div:not(#js-' + id + ')').slideUp();
});
});
Thanks @colegeissinger, got it with this.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here ya go! https://gist.github.com/colegeissinger/4741029 Check it out on Codepen to see it work and make sure it's your expected results.. http://codepen.io/colegeissinger/pen/qdvGB