Last active
July 26, 2020 15:57
-
-
Save berpj/3a484a0eb829cffbf15b40a461ad39aa to your computer and use it in GitHub Desktop.
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
$(function() { | |
/* | |
// TABS | |
*/ | |
$('body').on('click', '.w-tab-link', function(e) { | |
// Set to active the selected tab link | |
var selected = $(this).attr('data-w-tab') | |
$(this).closest('.w-tab-menu').find('.w-tab-link').removeClass('w--current') | |
$(this).addClass('w--current') | |
// Set to active the desired tab pane | |
$(this).closest('.w-tabs').find('.w-tab-pane').removeClass('w--tab-active') | |
$(this).closest('.w-tabs').find('.w-tab-pane[data-w-tab="' + selected + '"]').addClass('w--tab-active') | |
}) | |
/* | |
// DROPDOWNS | |
*/ | |
$('body').on('click', '.w-dropdown', function(e) { | |
var toOpen = ! $(this).find('.w-dropdown-toggle').hasClass('w--open') | |
$(this).find('.w-dropdown-list').toggleClass('w--open') | |
$(this).find('.w-dropdown-toggle').toggleClass('w--open') | |
if (toOpen) { | |
$(this).find('.w-dropdown-list').css({ | |
opacity: '1', | |
transform: 'translate3d(0px, 0px, 0px) scale3d(1, 1, 1) rotateX(0deg) rotateY(0deg) rotateZ(0deg) skew(0deg, 0deg)' | |
}) | |
$(this).find('.faq-open-close').css({ | |
transform: 'translate3d(0px, 0px, 0px) scale3d(1, 1, 1) rotateX(0deg) rotateY(0deg) rotateZ(0deg) skew(0deg, 0deg)' | |
}) | |
} else { | |
$(this).find('.w-dropdown-list').css({ | |
opacity: '0', | |
transform: 'translate3d(0px, -20px, 0px) scale3d(1, 1, 1) rotateX(0deg) rotateY(0deg) rotateZ(0deg) skew(0deg, 0deg)' | |
}) | |
$(this).find('.faq-open-close').css({ | |
transform: 'translate3d(0px, 0px, 0px) scale3d(1, 1, 1) rotateX(0deg) rotateY(0deg) rotateZ(45deg) skew(0deg, 0deg)' | |
}) | |
} | |
}) | |
/* | |
// CHECKBOXES | |
*/ | |
$('body').on('click', '.checkbox-section', function(e) { | |
$(this).find('.checkbox-show-hide').toggle() | |
}) | |
/* | |
// POPOVERS & MODALS | |
*/ | |
$('body').on('click', '.cancel-popover, .annuler-popover, .popover-bg', function(e) { | |
$(this).closest('.popover').hide() | |
return false | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment