标签: jquery-ui-button

jQuery UI按钮:如何覆盖用于单个按钮的类?

我正在使用基于主题的开箱即用的jQuery UI库.

将链接呈现为按钮很棒,但是我需要覆盖一些具有不同颜色的按钮.

如何为要使用的特定按钮指定特定类?

css jquery-ui jquery-ui-button

5
推荐指数
2
解决办法
2万
查看次数

jquery ui按钮不一致悬停状态

我有4个按钮使用Jquery UI的"按钮"功能.3完美无瑕地工作.第四个似乎并不想总是应用jquery ui悬停类"ui-state-hover"悬停时.它有一些时间,但大部分时间它只应用一个"悬停"类(我在萤火虫中观看它),这显然与他们的CSS样式不匹配.有没有人知道导致这种差异的原因是什么?

编辑:我认为这是UI按钮和Ajax上传器之间的冲突.这是我正在使用的一些修剪过的代码.

$('.upload_img').button({
    icons: {
        primary: 'ui-icon-folder-open'
    },
    label: "Browse"
    })





   jQuery('.upload_img').each(function(){

    var button = jQuery(this);
    var ID = jQuery(this).attr('value');
    var container = jQuery(this).parent();

    //prevent the clicks from its default 'form submit' behavior
    $(this).click(function() {
    return false;
    });             

    new AjaxUpload( button, {
        action: ajaxurl,
        name: ID , // File upload name
        data: { // Additional data to send
            action: 'save_function',
            type: 'upload',
            _nonce: '<?php echo $nonce; ?>',
            key: ID },
        onSubmit: function(file , ext){
            this.disable(); // If you …
Run Code Online (Sandbox Code Playgroud)

jquery jquery-ui jquery-ui-button

5
推荐指数
1
解决办法
1166
查看次数

在jquery .load()之后保留jquery-ui元素类

我有一个页面,我正在使用jQuery UI选项卡,我正在做的是通过Ajax加载每个选项卡的内容,但我遇到的问题是,在我的选项卡的内容中,按钮(我'使用jQuery ui按钮)丢失所有的jquery ui类,意思是:

当页面第一次加载时,我的按钮看起来像这样:

<button class="my_button ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only">
<span class="ui-button-icon-primary ui-icon ui-icon-plusthick"></span>
</button>
Run Code Online (Sandbox Code Playgroud)

如您所见,我的按钮具有所有jquery-ui类ui-button, ui-widget, etc....此外,我的按钮有一个跨度,显示加号(+)作为我的按钮的标签.因此,我的按钮显示正确.

但是当我通过Ajax加载相同的内容(包含相同的按钮)时,我的按钮变为如下:

<button class="my_button"></button>
Run Code Online (Sandbox Code Playgroud)

如您所见,我丢失了按钮的所有jQuery ui类.因此,按钮没有样式

我怎样才能解决这个问题?

注意:请注意,我没有手动将这些jquery-ui类添加到我的HTML中的按钮.当您使用$(".my_button").button();jQuery 初始化按钮时,jQuery会自动将所有必需的jquery-ui类适当地应用于我的按钮.所以请不要告诉我这是因为我没有事先将jquery-ui类分配给我的按钮(我不应该).另外,我试过.live() ,.delegate() ,这些都不工作.

请帮助我这个人

谢谢

jquery jquery-ui jquery-ui-tabs jquery-ui-button

5
推荐指数
1
解决办法
769
查看次数

使用jQueryUI时设置单选按钮的宽度

我正在使用jQuery UI单选按钮,并且无法找到如何将它们全部设置为固定宽度.

我正在使用的代码是:

<script type="text/javascript">
    $(document).ready(function () {
        $("#radio").buttonset();
    });
</script>

<div id="radio">
    <input type="radio" id="radio1" name="radio" /><label for="radio1">A</label>
    <input type="radio" id="radio2" name="radio" checked="checked" /><label for="radio2">Choice 2 - long long</label>
    <input type="radio" id="radio3" name="radio" /><label for="radio3">Choice 3</label>
</div>
Run Code Online (Sandbox Code Playgroud)

我是第一次使用jQuery,并且没有CSS或javascript经验.我已经尝试了各种奇怪的组合来尝试为按钮指定一个固定的宽度而不会丢失jQuery UI样式,但是没有运气.

任何帮助,将不胜感激.

jquery-ui width jquery-ui-button

4
推荐指数
1
解决办法
6988
查看次数

jQueryUI Buttonset CSS问题

我有一组Checkbox,我使用Buttonset使它们看起来像按钮

<div id="ButtonList">

    <input type="checkbox" id='Check0' value="true" /><label for="Check0">0000</label>
    <input type="checkbox" id='check1' value='false' /><label for="check1">0100</label>
    <input type="checkbox" id='check2' value='true' /><label for="check2">0200</label>
    <input type="checkbox" id='check3' value='false' /><label for="check3">0300</label>

</div>
Run Code Online (Sandbox Code Playgroud)

$('#ButtonList').buttonset();

$('#ButtonList input[type=checkbox]').change(function () {
    $(this).css("color", "red");
});
Run Code Online (Sandbox Code Playgroud)

我想要的是,当用户点击按钮以便更改按钮下的复选框时,颜色将在这种情况下变为红色.

我已经尝试了几个小时,没有运气,谷歌也没有多少帮助.

谢谢

jquery jquery-ui jquery-ui-button

3
推荐指数
1
解决办法
5010
查看次数

将图像添加到jquery按钮

我想知道如何将图像添加到jquery按钮.直到现在我在我的项目中使用了jquery ui按钮,我从图形团队获得了自定义图像,所以我想实现它们.

submit.button({ icons: {primary:'ui-icon-trash'}, text: false })
Run Code Online (Sandbox Code Playgroud)

如何将自定义图像添加到此jquery按钮?

jquery jquery-ui jquery-ui-button

2
推荐指数
1
解决办法
2万
查看次数

如何禁用jQuery-UI buttonset的一个按钮?

这里的例子:

http://jsfiddle.net/UVHtu/19/

我需要填补空白:

HTML:

<div id="options">
    <input type="radio" id="op_a" name="op" value="a" />
    <label for="op_a">Option A</label>
    <input type="radio" id="op_b" name="op" value="b" />
    <label for="op_b">Option B</label>
    <input type="radio" id="op_c" name="op" value="c" />
    <label for="op_c">Option C</label>
</div>
<input type="button" id="disable_button" value="Disable Option B" />
?
Run Code Online (Sandbox Code Playgroud)

JavaScript的:

$("#options").buttonset();

$("#disable_button").click(function(){
    // What goes here to disable option B?
});
Run Code Online (Sandbox Code Playgroud)

javascript jquery jquery-ui jquery-ui-button jqueryi-ui-buttonset

2
推荐指数
1
解决办法
2715
查看次数

删除jQuery UI对话框按钮边框/轮廓

我需要修改/更改哪个类来删除JQuery UI对话框按钮的轮廓.我似乎无法弄清楚哪个类正在应用'X'按钮周围的边框/轮廓.当我点击按钮时,轮廓消失了.

我正在使用这个CSS:http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.css

css jquery-ui jquery-ui-dialog jquery-ui-button

2
推荐指数
1
解决办法
1万
查看次数

如何使按钮无限闪烁,但有可能随时停止

我需要让按钮在其他元素触发后开始闪烁,例如选中复选框 - 请参阅下面的代码:

<label>I agree with the terms</label>
<input class="some_check" type="checkbox" id="Signed">
<button class="buttonstyle" name="buttonNext" onClick="nextChoose('NEXT')" disabled>Proceed!</button>
Run Code Online (Sandbox Code Playgroud)

闪烁必须是无限的,直到:

  1. 用户单击按钮或
  2. 取消选中该复选框.

我知道.effect()jQuery UI中有方法,但它是有时间限制的,如果我通过回调循环它,我怎么能打破它以返回先前状态的按钮?

jquery jquery-ui effects jquery-ui-button

0
推荐指数
1
解决办法
1万
查看次数

获取 jquery-ui 按钮集中的第 n 个按钮

有没有办法获取 jquery-ui 按钮集中的第 n 个按钮?

$( "#radio" ).buttonset();
Run Code Online (Sandbox Code Playgroud)
<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<div id="radio">
      <input type="radio" id="sizzle" name="project">
      <label for="sizzle">Sizzle</label>
 
      <input type="radio" id="qunit" name="project" checked="checked">
      <label for="qunit">QUnit</label>
 
      <input type="radio" id="color" name="project">
      <label for="color">Color</label>
</div>
Run Code Online (Sandbox Code Playgroud)

我可以使用 id 选择器来选择按钮 qunit。

但是有什么办法可以选择这组按钮中的第二个按钮吗?

javascript jquery jquery-ui jquery-ui-button

0
推荐指数
1
解决办法
181
查看次数