Created
April 17, 2017 10:13
-
-
Save kirandash/ba62f444670c378d856cc082bc50fe17 to your computer and use it in GitHub Desktop.
Expandable Buttons
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
| /******************************** | |
| * Expandible Buttons * | |
| ********************************/ | |
| focusActiveCheck(); | |
| var focusBtn = $("#page-focus .focus-image"); | |
| focusBtn.click(function(){ | |
| var target = $(this).attr('data-expand'); | |
| $('#expandables').find(".expand-content").hide(); | |
| $('#expandables').find(".expand-content[data-expandtarget='"+ target +"']").show(); | |
| if(target == "our-history" || target == "volunteers" || target == "support-us"){ | |
| $("footer#colophon").addClass("lifted-footer"); | |
| }else{ | |
| $("footer#colophon").removeClass("lifted-footer"); | |
| } | |
| focusActiveCheck(); | |
| }); | |
| //Focus Buttons Active state | |
| function focusActiveCheck(){ | |
| var visExpansion =$('#expandables').find(".expand-content:visible").attr('data-expandtarget'); | |
| $("#page-focus .focus-image").removeClass('active'); | |
| $("#page-focus .focus-image[data-expand='"+ visExpansion +"']").addClass('active'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment