Not necessarily a great idea, but you could add a new Sizzle selector for it :
$.expr[':'].width = function(elem, pos, match) {
return $(elem).width() == parseInt(match[3]);
}
which you could then use like so:
$('div:width(970)')
That's going to be horrifically slow, though, so you'd want to narrow down on the number of elements you're comparing with something like :
$('#navbar>div:width(970)')
to only select those divs that are direct descendants of the navbar, which also have a width of 970px.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…