How to detect lack of position:fixed in a generic way?

前端 未结 2 1385
广开言路
广开言路 2021-01-06 04:32

On mobile devices such as the iPad, I would like to disable a feature that only works if position:fixed is supported. Is there a way to detect these devices without using th

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-06 05:06

    also returns a false-positive on Opera Mini.

    Why not simply set a position:fixed on some element and then read it back? If position:fixed not supported returned value, should not be equal to fixed in theory

    that does not work on Opera Mini: you can set position to "fixed", it will read as "fixed" even though it is not supported.

提交回复
热议问题