Get all elements with `position:fixed` in an HTML page?

前端 未结 4 1099
梦毁少年i
梦毁少年i 2021-01-05 03:07

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.. th

4条回答
  •  日久生厌
    2021-01-05 03:23

    Try this:

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

    It will give you all elements having position fixed.

提交回复
热议问题