I want to show a pop-up when a variable '$myvar' has the value 'myvalue', so I put this code
<script type="text/javascript">
$(document).ready(function(){
if($myvar=='my value'){
$("#overlay").removeClass("invisible");
$("#message").removeClass("invisible");
}
$('#message #close').live('click',function() {
$("#overlay").addClass("invisible");
$("#message").addClass("invisible");
});
});
</script>
This is related to
<div id="overlay" class="invisible"></div>
<div class="invisible" id="message">
<div class="header">
<h2><span><?php echo _('some message!') ?></span> </h2>
<div id="close"></div>
</div>
</div>
So when the user comes to this page and when the variable is set to 'myvalue', the pop-up appears, but I can't close it when I cleick on the #close tag. Is the event 'click' bubbling so that the script is processed again ? If yes, how to prevent it ?