0

I would like the popup to automatically set on and not have to click to make the event. Can you help?

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
   $(document).ready(function(){     
   $('#open').click(function(){

     // enter code here
    $('.popup-overlay').fadeIn('slow');
    $('.popup-overlay').height($(window).height());
    return false;
});



$('#close').click(function(){
    $('#popup').fadeOut('slow');
    $('.popup-overlay').fadeOut('slow');
    return false;
  });
});
</script>
</head>
 <body>
  <div id="content">
   <div id="column-right"><a href="#" id="open">click aqui</a></div>

 </div>

 <div id="popup" style="display: none;">
  <div class="content-popup">
    <div class="close"><a href="#" id="close"><img src="images/close.png"/></a></div>
    <div> enter code here
        <h2>Contenido POPUP</h2>
  </div>
  </div>

Means whenever the page is loaded the pop up automatically opens without any client side event.

anwerj
  • 2,386
  • 2
  • 17
  • 36
user3802101
  • 21
  • 1
  • 5

2 Answers2

2

Just take the code out of the click() event:

And remove the div with .popup-overlay class. It's useless

$(document).ready(function(){
    $('#popup').fadeIn('slow');
    $('#popup').height($(window).height());
});
EduSanCon
  • 1,749
  • 1
  • 11
  • 9
0

You may need to fade the #popup also.

$(document).ready(function(){  
   $('#popup').fadeIn('slow');
   $('.popup-overlay').fadeIn('slow');
   $('.popup-overlay').height($(window).height());
});
anwerj
  • 2,386
  • 2
  • 17
  • 36