JS设置样式
程序员文章站
2022-03-02 17:32:25
...
IE9以上,google,firefox支持
document.getElementById('alert_wrap').style.setProperty('position', 'fixed')
document.getElementById('alert_wrap').style.setProperty('margin-left', -tanchuWidth / 2)
document.getElementById('alert_wrap').style.setProperty('margin-top', -tanchuHeight / 2)
IE9
document.getElementById('alert_wrap').style.position='fixed'
document.getElementById('alert_wrap').style.marginLeft=-tanchuWidth / 2
document.getElementById('alert_wrap').style.marginRight=-tanchuHeight / 2