开发者

JQuery multiple class selectors fails in IE6

I make use of class selectors in JQuery and this works fine but in IE6 this fails as it does not apply the width I would like.

    $('.ui-state-default .ui-jqgrid-hdiv').css('width', width);

If I try it one class it works?? But I need to apply that width to a div that has both those classes.

Thanks all for any help.

Update

$onselect = <<<loadComplete
function go_size(){

        var width = document.documentElement.clientWidth - 45;
        $('#gbox_grid').css('width', width);
        $('#gview_grid').css('width', width);
        $('#pager').css('width', width);
        $('.ui-state-default .ui-jqgrid-hdiv').css('width', width);
       开发者_开发知识库 $('.ui-jqgrid-bdiv').css('width', width)

}
loadComplete;


Remove the space between the class names. With your posted selector, you search for a child element .ui-jqgrid-hdiv inside a parent .ui-state-default.

Look here (W3C) and here (jQuery) for how to write selectors.

Also, look, if the class attribute spans multiple lines in the HTML source. IE 6 can't handle that correctly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜