动态修改元素样式,第一种情况下
position fixed
top 100px
第二种情况下是
position fixed
bottom xxpx
bottom是个动态的数值,需要js动态设置
当由第二种情况回到第一种情况时,bottom已经有值了,只能设置成bottom:initial,让他恢复成最原始的值,但是ie下不兼容initial属性,怎么兼容ie呢?
动态修改元素样式,第一种情况下
position fixed
top 100px
第二种情况下是
position fixed
bottom xxpx
bottom是个动态的数值,需要js动态设置
当由第二种情况回到第一种情况时,bottom已经有值了,只能设置成bottom:initial,让他恢复成最原始的值,但是ie下不兼容initial属性,怎么兼容ie呢?
这儿有一个问题是已经有了修改样式的js,直接把第一次的值缓存起来,需要时用js修改回去就可以,不管怎样都需要js设置一次.性能相差不大,且js减少了兼容性问题
10 回答11.2k 阅读
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答2.8k 阅读✓ 已解决
3 回答4.9k 阅读✓ 已解决
5 回答2k 阅读
3 回答2.3k 阅读✓ 已解决
bottom:auto