碱性溶液
解决问题的方法是:
<div style="display: none;" id="gallery-1">
<h2>Title 1 - Make this screen much bigger ****************************</h2>
<p> <a data-fancybox data-src="#signup" onclick='$.fancybox.close()' href='#'">Sign me up</a></p>
</div>
参考文献:
close fancy box from function from within open 'fancybox'
工作示例:
https://jsfiddle.net/euo4byj2/15/
工作代码:
<script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.4.1/jquery.fancybox.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.4.1/jquery.fancybox.min.js"></script>
<div style="display: none;" id="signup">
<h2>SIGN UP 1</h2>
<p>Content</p>
</div>
<!-- Item 1 -->
<a data-fancybox="gallery" data-src="#gallery-1" href="javascript:;">
Open Me
</a>
<div style="display: none;" id="gallery-1">
<h2>Title 1 - Make this screen much bigger ****************************</h2>
<p> <a data-fancybox data-src="#signup" onclick='$.fancybox.close()' href='#'">Sign me up</a></p>
</div>
<!-- Item 2 -->
<a data-fancybox="gallery" data-src="#gallery-2" href="javascript:;">
Open Me
</a>
<div style="display: none;" id="gallery-2">
<h2>Title 2</h2>
<p>Content</p>
<a data-fancybox data-src="signup" href="javascript:;">
</div>
<!-- Item 3 -->
<a data-fancybox="gallery" data-src="#gallery-3" href="javascript:;">
Open Me
</a>
<div style="display: none;" id="gallery-3">
<h2>Title 3</h2>
<p>Content</p>
<a data-fancybox data-src="signup" href="javascript:;">
</div>
<!-- Signup -->
<div style="display: none;" id="signup">
<h2>Signup</h2>
<p>Sign up form goes here</h2>
</div>
<script>
/* ( function( $ ) {
$('[data-fancybox]').fancybox({
closeExisting: true,
loop: true
});
} )( jQuery );
*/
</script>