1

パネルが閉じるたびに、イベントを使用してパネル内の折りたたみ可能なセットを閉じる方法を見つけようとしている次のコードがあります。次のリンクhttp://jsfiddle.net/rLjBB/4/の jfFiddle に例を含め、 以下のコードを含めました。jQuery Mobile フレームワークを使用してイベントの使用にアプローチする方法を理解するための助けが必要です。私はこのライブラリに関しては初心者なので、どんな支援もいただければ幸いです。

<body>

<div data-role="page" id="MuseMain">

    <div data-role="panel" id="leftmenupanel">

        <div data-role="collapsible-set" data-collapsed="true">
            <div  data-role="collapsible" data-theme="b" data-content-theme="d" >
                <h3>Overview</h3>
                <p>The overview provides what is normally seen on a book cover; the    name, author and description of the story.</p>
                <a href="" data-role="button" data-mini="true" data-icon="edit" data-inline="true" data-theme="a">Edit</a>
            </div>
        <div  data-role="collapsible" data-theme="b" data-content-theme="d" >
            <h3>Chapters & Scenes</h3>
            <p>The chapters are where the details of the chapters are defined and the actual storyline scenes are created..</p>
            <a href="" data-role="button" data-mini="true" data-icon="edit" data-inline="true" data-theme="a">Edit</a>
        </div>
        <div  data-role="collapsible" data-theme="b" data-content-theme="d" >
            <h3>Characters</h3>
            <p>The characters area is very detailed and allows the attributes to be defined, a detailed description, personality type, and relationships.</p>
            <a href="" data-role="button" data-mini="true" data-icon="edit" data-inline="true" data-theme="a">Edit</a>
        </div>


    </div>

</div><!-- /panel -->

<div data-role="header">

    <a href="#leftmenupanel" id="changeIconValue" data-role="button" data-icon="bars" data-theme="b" data-inline="true">Menu</a>

    <h1>Muse - A Writer's Assistant</h1>

</div>

<div data-role="content">

    <h2>Page content</h2>
    <p>Page content goes here.</p>

</div>
<div data-role="footer">
    <h1>Design By IntelligentDesigns</h1>
</div>

 </body>
4

1 に答える 1

0

これはあなたの問題を解決します:

$('#leftmenupanel').panel({
    close: function( event, ui ) {
        $('#leftmenupanel div[data-role="collapsible"]').trigger('collapse');
    }
});

更新されたフィドルに追加しました:http://jsfiddle.net/rLjBB/5/

于 2013-05-19T19:16:27.200 に答える