Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Accordion Icons Not Showing

I've never used the icon feature in jQuery before, but I assumed they would be part of the linked UI style sheet. Do I need to download the icon pack or something before they show up? Here's my project and everything is working, just no icons.

In the Header:

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>

And in the footer:

<script>
  jQuery(function() {
    var icons = {
      header: "ui-icon-circle-arrow-e",
      activeHeader: "ui-icon-circle-arrow-s"
    };
    jQuery( "#accordion" ).accordion({
      icons: icons,
      collapsible: true,
      active: false,
      heightStyle: "content"
    });
  });
</script>

And the actual html structure of the accordion elements:

<div id="accordion">
  <h3>Header Text</h3>
  <div>
    <p>Words and stuff</p>
  </div>
  <h3>Oh hello, I'm the second header</h3>
  <div>
    <p>SO MANY WORDS!</p>
  </div>
</div>

Thanks.

like image 857
Longblog Avatar asked Oct 17 '25 10:10

Longblog


1 Answers

You need to include some CSS files by the looks of it.

I've created a fiddle with your code, including the CSS file, and everything works fine.

http://jsfiddle.net/MaWsm/

<link href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" rel="stylesheet">

like image 197
rorymorris Avatar answered Oct 19 '25 03:10

rorymorris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!