My main DIV link does not work if I have a link in my internal DIV

Asked

Viewed 36 times

1

I have a DIV inside another, but my main DIV does not work the link if I put inside it a DIV with link to close.

CSS:

#guaraparivirtualsuperpopup {
    position:relative;
    width:1215px;
    height:500px;
    background-color:#000000;
    /* background-image:url(http://www.guaraparivirtual.com.br/Lay_Out/dr-bruno.jpg);
    background-repeat:no-repeat;
    background-position:50% 50%;
    */
    margin: 0 auto;

    border: 1px solid #EA8419;
}
#guaraparivirtualsuperpopupbtn {
    width:100px;
    height:36px;
    background-image:url(http://www.guaraparivirtual.com.br/img-novo/fechar.png);
    background-repeat:no-repeat;
    float:right;
    position: relative;

}

Javascript

<script type="text/javascript">
function superpopgv(guaraparivirtualsuperpopup) {

    if(document.getElementById(guaraparivirtualsuperpopup).style.display=="none") {
        document.getElementById(guaraparivirtualsuperpopup).style.display = "inline";
    }
    else {
        document.getElementById(guaraparivirtualsuperpopup).style.display = "none";
    }

}
</script>

DIV s

<a href="<?php echo $linkbannerrt; ?>" target="_blank" title="Super Pop-Up" / >
<div id="guaraparivirtualsuperpopup" style="background-image:url(superpopup/<?php echo $rt; ?>);">


<a href="#" onclick="javascript: superpopgv('guaraparivirtualsuperpopup');" />
<div id="guaraparivirtualsuperpopupbtn"></div>
</a>

</div>
</a>

If I put this link

<a href="#" onclick="javascript: superpopgv('guaraparivirtualsuperpopup');" />

The link below does not work

<a href="<?php echo $linkbannerrt; ?>" target="_blank" title="Super Pop-Up" / > 

How to solve?

2 answers

1

The link you refer to is not down below the other link and yes WITHIN from the other link.

Put in separate tags... See the code snippet below:

function superpopgv(guaraparivirtualsuperpopup) {

       if(document.getElementById(guaraparivirtualsuperpopup).style.display=="none") {
        document.getElementById(guaraparivirtualsuperpopup).style.display = "inline";
    }
    else {
        document.getElementById(guaraparivirtualsuperpopup).style.display = "none";
    }

}
#guaraparivirtualsuperpopup {
    position:relative;
    width:1215px;
    height:500px;
    background-color:#000000;
   /* background-image:url(http://www.guaraparivirtual.com.br/Lay_Out/dr-bruno.jpg);
    background-repeat:no-repeat;
    background-position:50% 50%;
    */
    margin: 0 auto;
    border: 1px solid #EA8419;
}
#guaraparivirtualsuperpopupbtn {
    width:100px;
    height:36px;
    background-image:url(http://www.guaraparivirtual.com.br/img-novo/fechar.png);
    background-repeat:no-repeat;
    float:right;
    position: relative;

}
<a href="http://www.testedolink.com.br/" target="_blank" title="Super Pop-Up">Link 1</a>

<div id="guaraparivirtualsuperpopup" style="background-image:url(http://lorempixel.com/output/food-h-c-207-324-10.jpg);">


<a href="#" onclick="javascript: superpopgv('guaraparivirtualsuperpopup');" >
<div id="guaraparivirtualsuperpopupbtn">Link2</div>
</a>

</div>

I hope I’ve helped, any questions just post a comment.

0

  • This may be the identification of the error, but it is not an answer that solves the problem. You can move your comment to the respective comment field.

  • Rafael vc is not confusing, through the link that posted, the element ""link", with the element "a" ?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.