From 4c7d6b0b3ed934cbd1c655f4fb29f27fbff62c0f Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Thu, 1 Mar 2012 19:33:42 -0300 Subject: [PATCH] Don't assume $ is jQuery. Rely on `jQuery` global instead. --- javascripts/tabs.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/javascripts/tabs.js b/javascripts/tabs.js index ca8fdbe..f513b24 100644 --- a/javascripts/tabs.js +++ b/javascripts/tabs.js @@ -8,19 +8,21 @@ * 8/17/2011 */ -$('body').on('click', 'ul.tabs > li > a', function(e) { - //Get Location of tab's content - var contentLocation = $(this).attr('href'); +jQuery(function ($) { + $('body').on('click', 'ul.tabs > li > a', function(e) { + //Get Location of tab's content + var contentLocation = $(this).attr('href'); - //Let go if not a hashed one - if(contentLocation.charAt(0)=="#") { - e.preventDefault(); + //Let go if not a hashed one + if(contentLocation.charAt(0)=="#") { + e.preventDefault(); - //Make Tab Active - $(this).parent().siblings().children('a').removeClass('active'); - $(this).addClass('active'); + //Make Tab Active + $(this).parent().siblings().children('a').removeClass('active'); + $(this).addClass('active'); - //Show Tab Content & add active class - $(contentLocation).show().addClass('active').siblings().hide().removeClass('active'); - } + //Show Tab Content & add active class + $(contentLocation).show().addClass('active').siblings().hide().removeClass('active'); + } + }); });