Created
February 22, 2010 01:22
-
-
Save mraichelson/310676 to your computer and use it in GitHub Desktop.
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
// find embedded links to other tabs and trigger tab behavior when they are clicked. | |
$j('div.tabContent a').each(function(i){ | |
var theLinkUrl = $j(this).attr('href'); | |
if(theLinkUrl.indexOf('#') != -1){ | |
if( theLinkUrl.split('#')[0] == '' || theLinkUrl.split('#')[0] == document.location ){ | |
$j(this).bind( | |
'click', | |
function(){ | |
if($j('ul.tabs a[href="#'+theLinkUrl.split('#')[1]+'"]').size()>0){ | |
$j('ul.tabs>li a[href="#'+theLinkUrl.split('#')[1]+'"]').trigger('click'); | |
this.blur(); | |
return false; | |
} | |
} | |
); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment