天天看點

html+ul隐藏滾動條,javascript 隐藏網頁滾動條

在safari浏覽器中,當滾動條至頁面底部,點選文檔,隐藏滾動條失效

demo3

body,ul{

margin:0;

font:12px/1.5 arial,'\5b8b\4f53',sans-serif;

}

ul{

padding:0;

list-style:none;

}

.hide{

overflow:hidden;

}

.wp{

width:1000px;

margin:0 auto;

background:#7c1;

}

.wp li{

width:300px;

height:500px;

}

#box{

width:300px;

height:300px;

background:#fff;

position:fixed;

top:50%;

left:50%;

margin:-150px 0 0 -150px;

}

#overlay{

width:100%;

height:100%;

background:#000;

opacity:0.5;

position:fixed;

left:0;

top:0;

}

window.onload = function(){

document.onclick = function(){

document.body.className = 'hide';

}

}