1

ビュープライバシーポリシーがあります。divに不透明度を追加しましたが、不透明度を削除する方法がわかりません。属性を削除しようとしていますが、機能しません。誰かが親切に私を助けてくれますか?その非常に緊急の要件。

<script type="text/javascript">


    function show(id)
    {
       if(document.getElementById("wrapper")) //check the element exists and can be accessed
       {   
           var ele = document.getElementById("wrapper");//get hold of the element
           if(ele.style.visibility=="visible")//see if display property is set to none
           {   
           }
           else
           {
                ele.style.visibility="visible";
               document.getElementById('LOGIN').style.opacity = 0.4;

           }
       }
    } 

    function hide(id)
    {
       if(document.getElementById("wrapper"))//check the element exists and can be accessed
       {    
           var ele = document.getElementById("wrapper");//get hold of the element
           if(ele.style.visibility=="visible")//see if display property is set to none
           {   
               ele.style.visibility="hidden"; 
           }
           else
           {

           }
       }
    } 

</script>
<style>
#wrapper {
position:absolute; 
z-index:1;
top:11%; bottom:5%; left:4%;right:15%;
width:87%;
height:75%;
font-size:15pt;
border:5px solid orange;
border-radius:25px;
overflow:auto;
visibility:hidden;
background-color:#ffffff;

}

#LOGIN.faded {
  opacity: 0.5;

}

</style>
  </head>
  <body >
   <div id="LOGIN" align="center">

            <table width="100%">
                <tr>
                    <td>
                        <input type="image" src="../images/header-sign-up.png" style="width:100%" alt=""/>
                    </td>
                </tr>
            </table>
            <div align="center">
                <a href="#" onclick ="show('showhide');">View privacy policy</a>

            </div>

   </div>
   <div id="wrapper">
                    <div id="scroller" >
                        <div id="popupContact" >
                            <a href="#" onclick ="hide('showhide');">Close Window</a><br/>
                            <p>
                                &nbsp;&nbsp;biler Privacy Policy

                                &nbsp;Please feel free to contact us with any comments, questions, complaints or suggestions you might have regarding the information practices described in this statement. You may send us an e-mail at 
                          </p>  
                        </div>
                    </div>
                </div>
   </body>
</html>
4

3 に答える 3

3

すでに持っている不透明度を試すか、表示してください...

document.getElementById('varContent').style.opacity = 0;
document.getElementById('varContent').style.opacity = 1;

また

document.getElementById('varContent').style.display = 'none';
document.getElementById('varContent').style.display = 'block';
于 2012-08-27T06:23:50.940 に答える
2

opacity値を作成する必要があります1

于 2012-08-27T06:20:37.723 に答える
0

Web Kit ベースのブラウザーで不透明度を 1 に設定すると、(不必要に) 表示が遅くなります (特に背景画像上で不透明度 1 のコンテンツをスクロールする場合)。

プロパティを完全に削除することをお勧めします (「removeProperty」メソッドを使用して、利用可能であることが確実な場合 (IE 9 以上):

element.style.removeProperty("opacity")

または、より互換性があります:

element.style.opacity = ""
于 2013-07-16T11:08:06.343 に答える