【问题标题】:jQuery buttonset imagesjQuery 按钮集图像
【发布时间】:2012-08-30 13:14:08
【问题描述】:

是否可以使用 jQuery buttonset() 将图像作为背景?

我试过这个标记,但设计搞砸了:

    <input type="radio" id="radio1" name="radio" />
    <label for="radio1" id="lbl1">
        <img src="images/red.png" />
    </label>
    <input type="radio" id="radio2" name="radio" checked="checked" />
    <label for="radio2">
        <img src="images/blue.png" />
    </label>
    <input type="radio" id="radio3" name="radio" />
    <label for="radio3">
        <img src="images/orange.png" />
    </label>

我搜索了插件,但没有找到我需要的。

有人试过吗?

【问题讨论】:

    标签: jquery jquery-ui radio-button


    【解决方案1】:

    你可以检查这个小提琴:

    http://jsfiddle.net/c3KmQ/

    它使用 jQueryUI 按钮集,易于定制:

    $( "#radio" ).buttonset();
    $($('.ui-button')[0]).addClass('bgcolor-red');
    $($('.ui-button')[2]).addClass('bgcolor-black');
    

    【讨论】:

    • 抱歉延迟回复。谢谢,这看起来像我需要的,但我得到了“Uncaught SyntaxError: Unexpected token ILLEGAL”。
    猜你喜欢
    • 1970-01-01
    • 2011-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多