单击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>

谢谢你。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)