单击href链接(wordpress)时如何在lightbox而不是window.open中加载php文件?

我需要在点击 href 链接时打开灯箱。
我只能使用以下代码打开一个弹出窗口(但我需要灯箱)。
你能告诉我如何打开灯箱吗?

popup.js:

jQuery(document).ready(function($) {
   $('.popup').click(function() {
     var popupWindow = window.open($(this).prop('href'),'','height=800,width=800,scrollbars=yes');
     if (window.focus)
     {
       popupWindow.focus();
     }
     return false;
    });
});


functions.php:

function techmuzz_popup() {
    wp_register_script( 'popup',get_stylesheet_directory_uri() . '/js/popup.js',array( 'jquery' ),'1.0.0',false );
    wp_enqueue_script( 'popup' );
 }

add_action('wp_enqueue_scripts','techmuzz_popup');


现有代码(使用插件创建):

<div class="dwqa-questions-list">
     <div class="dwqa-question-item dwqa-status-answered">
           <header class="dwqa-question-title">
                  <a href="https://www.myweb.com/question/%ed%9438472/" class="popup">Question One</a>
          </header>
     </div>
     <div class="dwqa-question-item dwqa-status-answered">
           <header class="dwqa-question-title">
                   <a href="https://www.myweb.com/question/%ed%94%90039/" class="popup">Question Two</a>
           </header>
     </div>
</div>

谢谢你。
ydp1016 回答:单击href链接(wordpress)时如何在lightbox而不是window.open中加载php文件?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/341911.html

大家都在问