Assertion: accordion's panel | /r/HasProperty | opened
Facets:
Source sentences:
text: Animated layers – set layers to display when the panel is opened, or when it’s closed, or all the time.
text: – set layers to display when the panel is opened, or when it’s closed, or all the time.
text: Swap image – change background image when panel is opened.
text: – change background image when panel is opened.
text: function(event, ui) { // The accordion believes a panel is being opened if (ui.newHeader) { var currHeader = ui.newHeader; var currContent = currHeader.next('.ui-accordion-content'); // The accordion believes a panel is being closed } else { var currHeader = ui.oldHeader; var currContent = currHeader.next('.ui-accordion-content'); } // Since we've changed the default behavior, this detects the actual status var isPanelSelected = currHeader.attr('aria-selected') == 'true'; // Toggle the panel's header currHeader.toggleClass('ui-corner-all',isPanelSelected).toggleClass('accordion-header-active ui-state-active ui-corner-top',!isPanelSelected).attr('aria-selected',((!isPanelSelected).toString())); // Toggle the panel's icon currHeader.children('.ui-icon').toggleClass('ui-icon-triangle-1-e',isPanelSelected).toggleClass('ui-icon-triangle-1-s',!isPanelSelected); // Toggle the panel's content currContent.toggleClass('accordion-content-active',!isPanelSelected) if (isPanelSelected) { currContent.slideUp(); } else { currContent.slideDown(); } return false; // Cancels the default action } });