Created
July 5, 2018 23:04
-
-
Save rsgranne/66361cc72aa679665fdbc19756c7edf0 to your computer and use it in GitHub Desktop.
Used with oasis-star-wars-bootstrap
This file contains hidden or 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
| $(document).ready( | |
| function() { | |
| var switcherFunc = function() { | |
| $('> .btn', this.parentNode).addClass('btn-default').removeClass('btn-primary'); | |
| $(this).addClass('btn-primary'); | |
| }; | |
| $('.sex .btn').on('click', switcherFunc); | |
| $('.race .btn').on('click', switcherFunc); | |
| $('.stats .btn').on('click', switcherFunc); | |
| var characterSwitcherFunc = function() { | |
| $('.btn', this.closest('.characters')).addClass('btn-default').removeClass('btn-primary'); | |
| $(this).addClass('btn-primary'); | |
| }; | |
| $('.characters .btn').on('click', characterSwitcherFunc); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment