Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery按钮集图像_Jquery_Jquery Ui_Radio Button - Fatal编程技术网

jQuery按钮集图像

jQuery按钮集图像,jquery,jquery-ui,radio-button,Jquery,Jquery Ui,Radio Button,是否可以使用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"

是否可以使用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>

我在谷歌上搜索插件,但没有找到我需要的


有人试过吗?

你可以检查这把小提琴:

它使用jQueryUI按钮集,可轻松定制:

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

很抱歉延迟回复。谢谢,这看起来像是我需要的,但我得到了上面的“未捕获的SyntaxError:意外令牌非法”。