Add sliding animations to the accordion. props kovshenin, DrewAPicture, helen. fixes #23890.

git-svn-id: https://develop.svn.wordpress.org/trunk@24644 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi 2013-07-10 16:32:09 +00:00
parent e01a1a94bb
commit 974508b221
2 changed files with 9 additions and 5 deletions

View File

@ -8884,9 +8884,6 @@ a.widget-control-edit {
.accordion-section.open .accordion-section-content,
.no-js .accordion-section .accordion-section-content {
display: block;
background: #fdfdfd;
border-left: 1px solid #dfdfdf;
border-right: 1px solid #dfdfdf;
}
.accordion-section.open:hover {
@ -8897,6 +8894,9 @@ a.widget-control-edit {
display: none;
padding: 10px 20px 15px;
overflow: hidden;
background: #fdfdfd;
border-left: 1px solid #dfdfdf;
border-right: 1px solid #dfdfdf;
}
.accordion-section-title {

View File

@ -5,12 +5,16 @@ jQuery(document).ready( function($) {
return;
e.preventDefault(); // Keep this AFTER the key filter above
var section = $( this ).closest( '.accordion-section' );
var section = $( this ).closest( '.accordion-section' ),
siblings = section.siblings( '.open' ),
content = section.find( '.accordion-section-content' );
if ( section.hasClass('cannot-expand') )
return;
section.siblings( '.open' ).removeClass( 'open' );
siblings.removeClass( 'open' );
siblings.find( '.accordion-section-content' ).show().slideUp( 150 );
content.toggle( section.hasClass( 'open' ) ).slideToggle( 150 );
section.toggleClass( 'open' );
});
});