如何将按钮添加到可折叠的标题

时间:2013-11-25 15:48:55

标签: jquery-mobile

有人知道将一些底部放在可折叠的标题中的技巧吗?

我试着用这个: http://jsfiddle.net/84g5c/

<div data-role="page" id="page1">
    <div data-theme="a" data-role="header">
        <h3>
            Header
        </h3>
    </div>

    <div data-role="content" class="lista">

        <div data-role="collapsible-set" data-theme="b" data-content-theme="c" class="collapsible">
            <div data-role="collapsible" data-collapsed="false" data-collapsed-icon="arrow-r" data-expanded-icon="arrow-d">
                <h3>
                    ¿How to put buttons here?           
                    <a href="index.html" data-role="button" data-icon="delete" data-iconpos="notext" data-mini="true">Delete</a>                    
                    <a href="index.html" data-role="button" data-icon="plus" data-iconpos="notext" data-mini="true">Add</a>                                     
                </h3>
                <ul data-role="listview" data-inset="false" id="tarea1" class="tarea">
                    <li data-theme="c">
                        <a href="#page1" data-transition="slide">
                            Button1
                        </a>
                    </li>
                    <li data-theme="c">
                        <a href="#page1" data-transition="slide">
                            Button2
                        </a>
                    </li>
                    <li data-theme="c">
                        <a href="#page1" data-transition="slide">
                            Button3
                        </a>
                    </li>
                    <li data-theme="c">
                        <a href="#page1" data-transition="slide">
                            Button4
                        </a>
                    </li>
                </ul>
            </div>
        </div>

    </div>
</div>

.ui-icon.ui-icon-delete.ui-icon-shadow{
    position: absolute !important;
    left: 0px !important;
}

.ui-btn.ui-shadow.ui-btn-corner-all.ui-btn-icon-notext.ui-btn-up-c{
    float: right !important;
}

谢谢!

1 个答案:

答案 0 :(得分:0)

Asnwer的隐形按钮,我觉得更优雅。如果您无法看到图标周围的按钮,请不要太难以适应。

http://jsfiddle.net/YaQ29/

<div data-role="collapsible" data-theme="b">
    <h2><p class=inline>ggggggggggg</p>
        <a class="inline coll_head_butt" data-theme="b" onclick="alert('clicked');" data-iconpos="notext" data-role="button" data-icon="check"></a>
    </h2>
</div>

CSS:

.inline{display:inline !important;}


.coll_head_butt{
    margin-left : 50px !important;
    /*padding:1em !important;*/
    border-style:none !important;
    box-shadow:none !important;
}

如果需要,您可以阻止按钮扩展折叠。