本文介绍了jQuery Mobile 列表上的多个拆分按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

jQuery 移动列表中是否可以有多个拆分按钮?

我试过这样做:

    <li><a href='#' id='1'>1</a><a href='#' id='btn1'></a><a href='#' id='btn2'></a>

但它不起作用.也不会将链接包装在

中.是我做错了什么,还是没有黑客就不可能?

UPDATE:通过执行$("#listid).append("<li>...</li>")动态生成列表. http://jsfiddle.net/nrpMN/3/ .正如下面的 mdmullinax 所指出的,以下确实有效:

    <li><a href='#' id='1'>1</a><div data-role='controlgroup' data-type='horizo​​ntal'><a href='#' id='btn1'></a><a href='#' id='btn2'></a>

谢谢

解决方案

听起来您想要的是嵌套在 listview 中的水平 controlgroup.

http://jsfiddle.net/nrpMN/

    <li><div data-role="controlgroup" data-type="horizo​​ntal"><a href="index.html" data-role="button">是</a><a href="index.html" data-role="button">否</a><a href="index.html" data-role="button">也许</a>

Is it possible to have multiple split buttons in a jQuery mobile list?

I've tried doing this:

<ul data-role='listview'>
    <li>
        <a href='#' id='1'>1</a>
        <a href='#' id='btn1'></a>
        <a href='#' id='btn2'></a>
    </li>
</ul>

But it doesn't work. Neither does wrapping the links in a <div data-role='controlgroup>. Am I doing something wrong, or is it just not possible without a hack?

UPDATE: The list is dynamically generated by doing $("#listid).append("<li>...</li>"). http://jsfiddle.net/nrpMN/3/ . As pointed out by mdmullinax below, the following does work:

<ul data-role='listview'>
    <li>
       <a href='#' id='1'>1</a>
        <div data-role='controlgroup' data-type='horizontal'>
            <a href='#' id='btn1'></a>
            <a href='#' id='btn2'></a>
        </div>
    </li>
</ul>

Thanks

解决方案

Sounds like what you want is a horizontal controlgroup nested in a listview.

http://jsfiddle.net/nrpMN/

<ul data-role='listview'>
    <li>
        <div data-role="controlgroup" data-type="horizontal">
            <a href="index.html" data-role="button">Yes</a>
            <a href="index.html" data-role="button">No</a>
            <a href="index.html" data-role="button">Maybe</a>
        </div>
    </li>
</ul>

这篇关于jQuery Mobile 列表上的多个拆分按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 20:46