Welcome to WebmasterWorld Guest from 54.146.201.80

Forum Moderators: open

Message Too Old, No Replies

Jquery for Overlay close and reopen

A cancel button closes the overlay but when the overlay is tried to reopen

     
1:33 pm on Oct 20, 2010 (gmt 0)

New User

5+ Year Member

joined:Feb 8, 2010
posts: 8
votes: 0

I have a subscribe form which has a continue button onclick of which the overlay pops up with two checkboxes. The overlay has two buttons submit and cancel submit is working fine with validations but when i cancel the overlay closes. But when i click on the continue button again nothing happens.
I am using the following code for loading the overlay when Continue button is clicked:

<script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/js/jquery.plugins.min.js"></script>

<script type="text/javascript">
var popup;
$(document).ready(function() {
//setup the consent popup
popup = $("#consentPopup").overlay({
mask: {
color: '#000000',
opacity: 0.5,
loadSpeed: 200
},
top: 'center',
closeOnClick: false
});


});


function Hcp_ParticipantContinue_Success() {

show();
}
function show()
{
if (document.getElementById('consentPopup').style.display == 'none')
{
popup.data("overlay").load();

}
}

//Hcp_ParticipantContinue is method which returns true after validating the form ,after this the overlay loads which has the div id="consentPopup"

//For Cancel button (id="consentCancel") following jquery is written within the consentPopup div at the end:

<script type="text/javascript">
var popup;
$("#consentCancel").click(function() {
popup.data("overlay").close();
popup = 1;
});
</script>

Please respond back with your replies.
2:16 pm on Oct 20, 2010 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts:4965
votes: 10


Your show method is checking to see if the element with id 'consentPopup' has it's display property set to none before it will attempt to call popup.data("overlay").load(). So I suspect that perhaps the popup.data("overlay").close() method does not set the 'concentPopup' display property to none. You might want to try adding a break point in Firebug to see what the values are.