开发者

onclick close modal and open popup

开发者 https://www.devze.com 2023-02-19 07:18 出处:网络
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 )

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号