Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
186
rated 0 times [  187] [ 1]  / answers: 1 / hits: 8172  / 8 Years ago, thu, january 28, 2016, 12:00:00

Reason for doing that: I'm debugging css of my webpage.. some elements appeared and they're not supposed to appear. I suspect it is the issue with element positioning.. therefore I want to find these positioned element and check one by one.


More From » jquery

 Answers
20

This one is using jQuery. I hope you are find with it.



 var find = $('*').filter(function () { 
return $(this).css('position') == 'fixed';
});


I think this one works using a pure javascript:



var elems = document.body.getElementsByTagName(*);
var len = elems.length

for (var i=0;i<len;i++) {

if (window.getComputedStyle(elems[i],null).getPropertyValue('position') == 'fixed') {
console.log(elems[i])
}

}

[#31239] Wednesday, January 27, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tyriquehenryq

Total Points: 248
Total Questions: 81
Total Answers: 105

Location: Bermuda
Member since Thu, Apr 20, 2023
1 Year ago
;