Created
December 9, 2013 02:14
-
-
Save srikat/7866492 to your computer and use it in GitHub Desktop.
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
jQuery(document).ready(function($) { | |
$("body").show(); | |
$( "#accordion" ).accordion({ | |
collapsible: true, | |
active: false, | |
header: '> div.my-accordion-section > h3', | |
heightStyle: 'content' | |
}); | |
}); |
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
html { | |
background: #33322D; | |
} | |
body.page-id-14 { | |
display: none; | |
} |
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
$("body").show(); |
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
collapsible: true, | |
active: false |
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
header: '> div.my-accordion-section > h3' |
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
heightStyle: 'content' |
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
function my_scripts_method() { | |
if ( is_page('14') ) { | |
wp_enqueue_script('jquery-ui-accordion'); | |
wp_enqueue_script( | |
'custom-accordion', | |
get_stylesheet_directory_uri() . '/js/accordion.js', | |
array('jquery') | |
); | |
} | |
} | |
add_action('wp_enqueue_scripts', 'my_scripts_method'); |
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
<div id="accordion"> | |
<div class="my-accordion-section"> | |
<h3>Header 1</h3> | |
<div> | |
Ut gravida lobortis diam non varius. Duis tempor cursus justo ut consequat. Donec bibendum sem arcu, at placerat orci ultricies sed. Donec tortor diam, tincidunt a molestie nec, volutpat vitae nisl. Sed vitae arcu eu ante ultrices aliquet non vitae nisi. | |
</div> | |
</div> | |
<div class="my-accordion-section"> | |
<h3>Header 2</h3> | |
<div> | |
Praesent iaculis lacus quis elementum vulputate. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean vitae viverra nisi. Aenean luctus tristique ligula. Vivamus tempus eu odio nec ultrices. | |
</div> | |
</div> | |
<div class="my-accordion-section"> | |
<h3>Header 3</h3> | |
<div> | |
Phasellus ligula eros, interdum et posuere ut, dapibus ac tortor. Sed sagittis a nibh sed posuere. Aenean id lacus eu mauris semper eleifend. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. | |
</div> | |
</div> | |
</div> |
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
#accordion { | |
margin-top: 0.3em; | |
} | |
h3.ui-accordion-header { | |
color: #FFFFFF; | |
font-weight: normal; | |
text-transform: uppercase; | |
font-size: 0.9em; | |
letter-spacing: 0.15em; | |
background: url("images/square-bullet.gif") no-repeat; | |
padding-left: 2.5em; | |
} | |
h3.ui-accordion-header:hover, | |
h3.ui-accordion-header.ui-state-active { | |
background: url('images/square-bullet-hover.gif') no-repeat; | |
} | |
.my-accordion-section { | |
margin-bottom: 2.5em; | |
} | |
.ui-accordion-content { | |
color: #C9C9C9; | |
padding-left: 2.5em; | |
} |
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
$("#ui-accordion-accordion-header-0").delay(200).fadeIn(); | |
$("#ui-accordion-accordion-header-1").delay(400).fadeIn(); | |
$("#ui-accordion-accordion-header-2").delay(600).fadeIn(); | |
$("#ui-accordion-accordion-header-3").delay(800).fadeIn(); | |
$("#ui-accordion-accordion-header-4").delay(1000).fadeIn(); | |
$("#ui-accordion-accordion-header-5").delay(1200).fadeIn(); | |
$("#ui-accordion-accordion-header-6").delay(1400).fadeIn(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment