2012-08-27 2 views
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> 
+2

차례의 불투명도 값? 또한 IE에서 작동하도록 http://www.quirksmode.org/js/opacity.html 참조하십시오. – DhruvPathak

답변

2

((불필요) 화면 아래로 느려집니다 1의 불투명도를 설정 ... 웹 키트 기반 브라우저와

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

또는

document.getElementById('varContent').style.display = 'none'; 
document.getElementById('varContent').style.display = 'block'; 
1

당신은 opacity1을해야한다.

+0

감사합니다. – JavaH

0

을 당신이 이미 가지고있는 불투명도를 시도하거나 표시 특히 배경 이미지 위에 불투명도 1로 내용을 스크롤하는 경우)

더 나은 속성을 모두 제거하는 것이 좋습니다 (확실한 경우 "removeProperty"방법을 사용하거나 르 (IE 9 이상) :

element.style.removeProperty("opacity") 

또는 호환성 : 1.0

element.style.opacity = "" 
관련 문제