Jquery 对话框按钮文本鼠标悬停光标更改

标签 jquery html css

我正在使用 jquery 版本 1.8.3 对话框控件,其中有两个按钮。

$('<div></div>').appendTo('body').html().dialog({
            modal: true,  zIndex: 10000, autoOpen: true,
            width: '450px', resizable: false,stack: false,
            dialogClass: 'closeDialog',
            buttons: {
                "YesButton" : {
         text: "Yes",
                id: "yesbtnid",               
                } ,
                "NoButton" : {
                text: "No",
                id: "nobtnid",               
                }
            },
            open: function() {              
                $(this).closest('.ui-dialog').find('.ui-button').removeClass("ui-button").addClass("btnHeightWidth");
                });
               }
        });

我已将我的 css 类添加到按钮,我的 css 类是

.btnHeightWidth
{
    width:100px;
    height:43px;
    font-Weight:bold;
    font-size:16px;
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFEEE9E2', endColorstr='#FFC5BFB5');
    behavior: url(border-radius.htc);
    border-radius: 11px;
    -webkit-border-radius: 11px;
   cursor:pointer;
}

问题是当我将鼠标悬停在按钮文本上时,"is"或“否”鼠标光标从手形变为指针,如何使它像手形一样不变。

最佳答案

试试这个 CSS:

.ui-dialog .ui-dialog-buttonpane button.ui-state-hover.ui-widget .ui-button-text{
      cursor:pointer;
}

关键是特定于应用样式。您可以修改 jquery-ui.css 中的样式或创建更具体的选择器。您也可以使用 !important 但不建议这样做。

此外,您不需要使用 jQuery 从按钮中删除任何类。 我将您的代码更新为:

$(this).closest('.ui-dialog').find('.ui-button').addClass("btnHeightWidth");

更新代码:http://jsfiddle.net/lotusgodkk/CC9gM/8/

关于Jquery 对话框按钮文本鼠标悬停光标更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23560921/

相关文章:

php - jQuery getJSON() 似乎无法正常工作

javascript - 动态添加div及其内容

javascript - iframe 中的 jquery 搜索

jquery - 带对比滤波器的输入范围

javascript - 为什么 css hover 与 javascript (fullpage.js) 交互,我该如何阻止它?

javascript - 用于查看带有叠加层的大图像( map )的 HTML/Javascript 选项

javascript - 侧滑菜单选项卡

html - 如何将 div 与 "display: inline-block"连续放置,没有边距?

html - 使用 CSS 选择器查找与另一个 ID 相同但类不同的元素

html - 在所有 href 标签文本下划线 : issues with having </span><br/><span> inside href tag