Web Development with jQuery®

(Elliott) #1

Setting the Header Elements (^) ❘ 381



  • George Harrison



    Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    Vestibulum luctus rutrum orci. Praesent faucibus tellus
    faucibus quam. Aliquam erat volutpat. Nam posuere.




  • Ringo Starr



    Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    Vestibulum luctus rutrum orci. Praesent faucibus tellus
    faucibus quam. Aliquam erat volutpat. Nam posuere.






  • The following style sheet is applied to the preceding markup document:
    body {
    font: 12px "Lucida Grande", Arial, sans-serif;
    background: #fff;
    color: rgb(50, 50, 50);
    margin: 0 ;
    padding: 0 ;
    }
    ul {
    list-style: none;
    margin: 0 ;
    padding: 15px 5px;
    }
    h4,
    ul h4,
    ul p {
    margin: 5px;
    }
    li {
    background: gold;
    padding: 3px;
    width: 244px;
    margin: 1px;
    }
    In the following script, you change the element that’s used as the header for each content pane by
    providing a selector to the header option, in this case h4, which causes the

    element of each

  • element to be used as a header, rather than the element:
    $(document).ready(
    function()
    {
    $('ul').accordion({
    active : 1,
    [http://www.it-ebooks.info](http://www.it-ebooks.info)
  • ← Previous
    Free download pdf