Skip to content

Instantly share code, notes, and snippets.

@kirandash
Created April 17, 2017 10:13
Show Gist options
  • Select an option

  • Save kirandash/ba62f444670c378d856cc082bc50fe17 to your computer and use it in GitHub Desktop.

Select an option

Save kirandash/ba62f444670c378d856cc082bc50fe17 to your computer and use it in GitHub Desktop.
Expandable Buttons
/********************************
* 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