window.onload = function(event) {
document.getElementById("该元素的id").style.width = event.currentTarget.outerWidth + 'px';
}
通过获取window对象的event以获取当前窗口的width,将其直接赋值给需要设置width=100%的标签。
window.onload = function(event) {
document.getElementById("该元素的id").style.width = event.currentTarget.outerWidth + 'px';
}
通过获取window对象的event以获取当前窗口的width,将其直接赋值给需要设置width=100%的标签。