Jump to content
Fórum Script Brasil
  • 0

Erro com Accordion


Alexandre Carmo

Question

Boa noite

Pessoal estou fazendo alguns testes com a Jquery UI e estou com um problema ao tentar fazer um exemplo do site, no caso estou tentando fazer o exemplo Accordion, a única diferença básica é que no exemplo do site ele chama as bibliotecas por módulos ou seja esta dessa forma a chamada:

<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
        <script src="../../jquery-1.5.1.js"></script>
        <script src="../../ui/jquery.ui.core.js"></script>
        <script src="../../ui/jquery.ui.widget.js"></script>
        <script src="../../ui/jquery.ui.mouse.js"></script>
        <script src="../../ui/jquery.ui.sortable.js"></script>
        <script src="../../ui/jquery.ui.accordion.js"></script>
        <link rel="stylesheet" href="../demos.css">
link do exemplo no site, é logo o primeiro: exemplo No caso estou tentando fazer isso usando a biblioteca completa dessa forma:
<link rel="stylesheet" href="jquery.ui.all.css">
        <script src="jquery-1.5.1.js"></script>
        <script src="jquery-ui-1.8.14.custom.min.js"></script>
        <link rel="stylesheet" href="demos.css">
Claro que na minha aplicação as bibliotecas estão todas no mesmo diretorio junto do html, porém na hora de exibir ele exibe todas div abertas e sem formatação ou efeitos. Onde estou errando? Veja meu exemplo completo:
<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="utf-8">
        <title>jQuery UI Accordion - Sortable</title>
        <link rel="stylesheet" href="jquery.ui.all.css">
        <script src="jquery-1.5.1.js"></script>
        <script src="jquery-ui-1.8.14.custom.min.js"></script>
        <link rel="stylesheet" href="demos.css">
        <script>
        $(function() {
                var stop = false;
                $( "#accordion h3" ).click(function( event ) {
                        if ( stop ) {
                                event.stopImmediatePropagation();
                                event.preventDefault();
                                stop = false;
                        }
                });
                $( "#accordion" )
                        .accordion({
                                header: "> div > h3"
                        })
                        .sortable({
                                axis: "y",
                                handle: "h3",
                                stop: function() {
                                        stop = true;
                                }
                        });
        });
        </script>
</head>
<body>

<div class="demo">

<div id="accordion">
        <div>
                <h3><a href="#">Section 1</a></h3>
                <div>
                        <p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p>
                </div>
        </div>
        <div>
                <h3><a href="#">Section 2</a></h3>
                <div>
                        <p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p>
                </div>
        </div>
        <div>
                <h3><a href="#">Section 3</a></h3>
                <div>
                        <p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p>
                        <ul>
                                <li>List item one</li>
                                <li>List item two</li>
                                <li>List item three</li>
                        </ul>
                </div>
        </div>
        <div>
                <h3><a href="#">Section 4</a></h3>
                <div>
                        <p>Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. </p><p>Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p>
                </div>
        </div>
</div>

</div><!-- End demo -->



<div class="demo-description">
<p>Drag the header to re-order panels.</p>
</div><!-- End demo-description -->

</body>
</html>

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...