Created
June 30, 2015 02:16
-
-
Save kezzbracey/b421ad18c536c1de075d to your computer and use it in GitHub Desktop.
Menu fix
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
<!-- In "mainmenu.php" find this code on line 7 --> | |
<script type="text/javascript"> | |
jQuery(document).ready( function(){ | |
jQuery( '.mainmenuselect' ).change(function() { | |
window.location = jQuery(this).find( 'option:selected' ).val(); | |
}); | |
}); | |
</script> | |
<!-- Add this line of code after line 8 --> | |
jQuery( '.mainmenuselect' ).find( 'option[value="' + window.location.href + '"]' ).prop('selected', true); | |
<!-- You should end up with this code: --> | |
<script type="text/javascript"> | |
jQuery(document).ready( function(){ | |
jQuery( '.mainmenuselect' ).find( 'option[value="' + window.location.href + '"]' ).prop('selected', true); | |
jQuery( '.mainmenuselect' ).change(function() { | |
window.location = jQuery(this).find( 'option:selected' ).val(); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment