I want an array of all elements that have fixed position.
This is what I’ve got so far (mootools code)
$$('*').filter(function(aEl){ return aEl.getStyle('position')=='fixed' });
Is there a more direct way to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
not really, what you posted is the best way of doing it.
but if it’s something you do more often, I’d consider abstracting it to a pseudo selector:
p.s. this will break in mootools 1.3 as slick uses a different selectors engine.
to make it work in 1.3 do:
and finally, to make it more versatile so you can look up any CSS property as a part of the selector, you can do something like this:
and for mootools 1.3:
how to use it:
http://www.jsfiddle.net/h7JPS/3/