Created
September 13, 2011 05:15
-
-
Save ghostbar/1213171 to your computer and use it in GitHub Desktop.
Script for swapping img's src attr synced with tabs from jQueryUI
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
/* @author Jose Luis Rivas <[email protected]> | |
* | |
* @desc swaping full-background pages with jQuery UI's Tabs plugin events. | |
*/ | |
$(document).ready(function() { | |
$( "#slides" ).bind( "tabsshow", function(event, ui) { | |
var tabattr = $('.ui-state-active').find('a').attr('href'); | |
switch(tabattr) { | |
case '#tab1': | |
$('img#bg').attr('src', '/img/tab1.jpg'); | |
break; | |
case '#tab2': | |
$('img#bg').attr('src', '/img/tab2.jpg'); | |
break; | |
default: | |
$('img#bg').attr('src', '/img/tab1.jpg'); | |
break; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment