

我们可以这样解决
在js代码中加如下代码:
window.onscroll = function() {
var sl = -Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
document.getElementById('fixed').style.left = sl + 'px';
console.log(sl);
}


可能在手机浏览时还会出现这个问题再把它的css代码加上overflow-x: hidden即可
.head {
background: #fff;
position: fixed;
z-index: 100;
min-width: 1200px;
height: 60px;
background: #fff;
top: 0;
bottom: 0;
/* overflow-x: scroll;*/
overflow-x: hidden;
}
网友评论