onclick close modal and open popup
We have a Modal Window with a contact form within it.
We have two buttons at the bottom, of the form.
One of which on click opens a separate live chat window ( not modal )
So my issue is onclick of the button ( on the modal window ) I want to open the popup window, ( which we have fully working ) but simultaneously, close the modal window. As it is not needed.
The link code is:
<a href="<?=curPageURL();?>#" onclick="javascript:launchSupport(开发者_如何学C'https://www.somesite.com.au/livechat/chat.php', '200', '200', '510', '440');jQuery.lightbox().close();"><span class="newSamplePromo">Live Chat</span></a>
Since you're already using jQuery, just give that <a>
tag an ID and then assign a click handler for it using jQuery.
jQuery(function() {
jQuery("#liveChatLink").click(function(e) {
e.preventDefault();
launchSupport('https://www.somesite.com.au/livechat/chat.php', '200', '200', '510', '440');
jQuery.lightbox().close();
});
});
<a id="liveChatLink" href="<?=curPageURL();?>#"><span class="newSamplePromo">Live Chat</span></a>
精彩评论