0

I am using Portlet from jquery ui Sortable Demo. I am trying to define Hover on ui-icon-minusthick by adding ui-state-hover class. But the results are unexpected.I was hoping to get a rectangle on hover as is ui buttons but instead it shows a rectangle with weird background.

JSFIDDLE: http://jsfiddle.net/bababalcksheep/ugnFw/

HTML:

<div class="portlet ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
    <div class="portlet-header ui-widget-header ui-corner-all">
        <span class="ui-icon ui-icon-minusthick"></span>
        Links
    </div>
    <div class="portlet-content">Data Content</div>
</div>

CSS:

.portlet{margin:0 1em 1em 0}
.portlet-header{padding-bottom:4px;padding-left:.2em;margin:.3em}
.portlet-header .ui-icon{float:right;margin-right:10px}
.portlet-content{padding:.4em}

JS:

$(".portlet-header .ui-icon").hover(

function () {
    $(this).addClass('ui-state-hover');
},

function () {
    $(this).removeClass('ui-state-hover');
});

enter image description here

4

1 回答 1

0

JSFIDDLE:http: //jsfiddle.net/bababalcksheep/ugnFw/10/

CSS添加:

.portlet-header a { 游标:指针;浮动:对;边距:2px;
位置:相对;}

HTML:

<div class="portlet ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
    <div class="portlet-header ui-widget-header ui-corner-all ">
        <a href="#" class=" ui-corner-all" title="close">
            <span class="ui-icon ui-icon-minusthick"></span>
        </a>
        Links
    </div>
    <div class="portlet-content">Data Content</div>
</div>
于 2013-10-01T10:25:10.150 回答