开发者

Jquery selector by width

Would it b开发者_如何学编程e possible to select a table with a specific width ?

Thanks


Use the filter() function:

$('table').filter(function() {
    return $(this).width() > 700;
});


Yes like this:

$('table[width="700"]')

Or you can get all tables having width with whatever value like this:

$('table[width]')


Or create your own selector

$.expr[':'].atLeast700px = function(obj){
  return $(obj).width() >= 700;
};


$('table:atLeast700px');  // returns all your tables 700px or wider
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜