Skip to content

Instantly share code, notes, and snippets.

@IanRamosC
Last active August 29, 2015 14:19
Show Gist options
  • Save IanRamosC/693969dc274233d1ac39 to your computer and use it in GitHub Desktop.
Save IanRamosC/693969dc274233d1ac39 to your computer and use it in GitHub Desktop.
workaround
var tab = jQuery('.tabs .tab-title a');
var uriBase = document.baseURI;
jQuery('.tabs .tab-title a img').first().attr('src', jQuery('.tabs .tab-title a img').first().attr('src').replace('_off', '_on'));
tab.mousedown(function(){
var allImgs = jQuery('.tabs .tab-title a img');
allImgs.each(function() {
jQuery(this).attr('src', jQuery(this).attr('src').replace('_on', '_off'));
});
var classe = jQuery(this).attr('class');
var newSrc = uriBase + 'wp-content/themes/proudmoore/assets/img/tabs-icon/' + classe + '_on.png';
jQuery(this).find('img').attr('src', newSrc);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment