Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 14700

I.E. Bloqueando e Chorme diz que função é inválida

$
0
0
Pessoal, no código abaixo tenho um botão fechar para fechar sua div pai.

No I.E. o Javascript é bloqueado mas se desbloquear a função roda e o Chorme diz que "indefinido não é uma função".
Cheguei a criar um botão dentro da div e outro fora da div.
Dos dois jeitos o comportamento é o mesmo.

Qual será o erro?

Código (HTML):
  <html>
        <head>
<title>Bem Vindo</title>

<script>
  function fechar(div)
           {
        alert(div);
                  document.getElementById(div).style.display = "none";
           }
</script>
<style type="text/css">
           #entrada
        {
          top: 0;
                  left:0;
          width:100%;
          height:100%;
          position: absolute;
          background-color: #000;
          opacity: .8;
                }

  img#banner
        {  
  width: 300px;
                   position: absolute;
                   top: 50%;
  margin-top:-150px;
                   left: 50%;
  ;
                   border: 0;
                 }
#fechada
{
  z-index:10;
  width: 50px;
                   position: absolute;
                   top: 50%;
  margin-top:0px;
                   left: 50%;
  margin-left: 0px;
                   border: 0;
}
           img#fechar
        {  
  z-index:1;
  width: 50px;
                   position: absolute;
                   top: 50%;
  margin-top:-180px;
                   left: 50%;
  margin-left: 125px;
                   border: 0;
                 }
          </style>
        </head>

<body>
           <img src="aa.jpg" />
           <div id="fechada">
<img src="fechar.png" id="fechar" width="500px" onclick="fechar('entrada');" />
  </div>
           <div id="entrada">
<img src="fechar.png" id="fechar" onclick="fechar('entrada');" />
        <a href="../eleicoes2014"><img src="bannerClique.jpg" id="banner" /></a>
  </div>
</body>
</html>

Viewing all articles
Browse latest Browse all 14700

Trending Articles