我想实现两个button随滚动条的滚动而滚动,在火狐上可以实现,但在ie或360上则实现不了,报错提示p.style尚未实现。求大神解决,附上部分代码:
回复留言
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
一般我们在js里修改属性的话,我们会采用1、少量属性使用[元素].style.[属性名]=值的形式,如:p.style.position="absolute";2、多的话采用[元素].style.cssText=[属性名:值],如:p.style.cssText="height:20px;postion:relative;width:30px";
固定位置吗?为什么position不是fixed?
p.style = "position: absolute;right: 60px;top: "+height ;这行代码拆开写就行后面没有加‘px’单位