我有以下标记,我想使用 jQuery UI 手风琴,但它不像我在 HTML5 之前制作的典型手风琴那样呈现。我怎样才能通过使用文章/部分来获得手风琴?
<article>
<h1>Accordion</h1>
<div id="accordion">
<section>
<h1><a href="#">Aliquam tincidunt mauris eu risus.</a></h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus hendrerit. Pellentesque aliquet nibh nec urna.</p>
</section>
<section>
<h1><a href="#">Integer vitae libero ac risus egestas placerat.</a></h1>
<p>Sed egestas, ante et vulputate volutpat, eros pede semper est, vitae luctus metus libero eu augue. Morbi purus libero, faucibus adipiscing, commodo quis, gravida id, est. Sed lectus.</p>
</section>
<section>
<h1><a href="#">Fusce lobortis lorem at ipsum semper sagittis.</a></h1>
<p>Morbi interdum mollis sapien. Sed ac risus. Phasellus lacinia, magna a ullamcorper laoreet, lectus arcu pulvinar risus, vitae facilisis libero dolor a purus. Sed vel lacus.</p>
</section>
</div>
</article>
在javascript中我使用:
$(document).ready(function (){
$('#accordion').accordion();
});