簡體   English   中英

Magnific Popup模式內的鏈接不起作用

[英]Link inside Magnific Popup modal not working

我有一個非常簡單的放大彈出模式,其中包含一個鏈接。 但是,單擊鏈接時,URL不會加載,唯一的繼續方法是關閉模式。 這是我啟動彈出窗口的代碼:

jQuery(document).ready(function( $ ) {
    $('.popup-content').magnificPopup({
            type: 'inline',
            fixedContentPos: true,
            fixedBgPos: true,
            overflowY: 'scroll',
            closeBtnInside: true,
            preloader: false,
            callbacks: {
                beforeOpen: function() {
                this.st.mainClass = this.st.el.attr('data-effect');
                }
            },
            midClick: true,
            removalDelay: 300
        });

});

而我的HTML:

<a class="popup-content" href="#modal" data-effect="my-mfp-slide-bottom">Open popup link</a>

<div id="modal" class="zoom-anim-dialog mfp-hide">
<a href="http://example.com">This link does not work</a>
</div>

添加onclick='window.open("https://example.com");' 到錨標記。因此,您的鏈接現在看起來像<a href="http://example.com" onclick='window.open("https://example.com");'>This link does not work</a>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM