3

有什么方法可以将拆分按钮(ListView 附带)添加到可折叠的;我已经尝试/测试了以下代码,但不起作用!

    <div data-role="collapsible-set" data-theme="a" data-content-theme="e"  data-split-icon="gear" data-split-theme="e">

<div data-role="collapsible">      

<h3> Breakfast </h3>

<p>
<a href="somthing.html"> the contents comes here. 
</a>
</p>

<a href="#purchase" data-rel="popup" data-position-to="window" data-transition="pop">
split button 2
</a>
</div>


<div data-role="collapsible">      

<h3> Lunch</h3>

<p>
<a href="somthingElse.html"> the contents comes here. 
</a>
</p>

<a href="#purchase" data-rel="popup" data-position-to="window" data-transition="pop">
split button 2
</a>
</div>


</div>

任何想法或任何其他解决方案(解决方法)都非常受欢迎。

4

1 回答 1

3

好吧,它需要一些工作,但这就是我所拥有的

现场示例:

JS

$(".splitButtonClicked").on("click", function (event, ui) {
    alert('Hello');
    return false; // stop collapsible event
});

HTML

<div data-role="page" id="home">
    <div data-role="content">
        <div data-role="collapsible-set" data-theme="b" data-content-theme="d">
            <div data-role="collapsible">
                <h2>
                    <ul data-role="listview" data-split-icon="gear" data-split-theme="d">
                        <li><a href="#">
                            <h3>Breakfast</h3>
                        </a><a href="#breakfast_menu" data-rel="popup" data-position-to="window" data-transition="pop" class="splitButtonClicked">View Menu</a>
                        </li>
                    </ul>
                </h2>
            </div>
            <div data-role="collapsible">
                <h2>
                    <ul data-role="listview" data-split-icon="gear" data-split-theme="d">
                        <li><a href="#">
                            <h3>Lunch</h3>
                        </a><a href="#lunch_menu" data-rel="popup" data-position-to="window" data-transition="pop" class="splitButtonClicked">View Menu</a>
                        </li>
                    </ul>
                </h2>
            </div>
        </div>
    </div>
</div>

希望这可以帮助你

于 2013-01-24T14:07:04.110 回答