2
我試圖模糊背景頁面並彈出一個未模糊的加載框。我會認爲blur(0px)
會刪除加載div上的模糊。但是,彈出框也保持模糊。Javascript/CSS webkit過濾器 - 刪除特定元素上的模糊
如何僅刪除特定元素的模糊?
<script>
document.getElementById("blurme").setAttribute("style","-webkit-filter: blur(3px)");
document.getElementById("loading").setAttribute("style","-webkit-filter: blur(0px)");
</script>
<html>
<body id="blurme">
<h1>Welcome to My Website</h1>
<div id="loading">
Please wait
</div>
</body>
</html>
這裏的CSS加載盒
#loading
{
background:#808080 url(loading.gif) no-repeat center center;
background-size:220px 50px;
height: 270px;
width: 75px;
position: fixed;
left: 50%;
top: 50%;
margin: -175px 0 0 -275px;
z-index: 1000;
border-radius: 15px;
display:none;
}