jQuery Mobile列表上的多个拆分按钮 [英] Multiple split buttons on jQuery Mobile list

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

问题描述

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

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

我尝试这样做:

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

但是它不起作用.也不会将链接包装在<div data-role='controlgroup>中.我是在做错什么,还是没有黑客是不可能的?

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?

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

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>

谢谢

推荐答案

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

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列表上的多个拆分按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆