如何在单击现有的 href 链接(wordpress)时打开灯箱?

我需要在点击 href 链接时打开灯箱。
我尝试了以下代码,但它没有打开灯箱(网址在同一浏览器中打开)。
你能告诉我如何打开灯箱吗?

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

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

我试过的灯箱代码:
控制台显示一个错误:
Unexpected token '<' => <!DOCTYPE html>

?>
<script language="JavaScript" type="text/javascript" src="jquery/jquery.js"></script>
<script>
        (function($){
           $(document).ready(function() {
            $("a",".dwqa-question-title").click(
              function(event) {
                event.preventDefault();
                var elementURL = $(this).attr("href");
                $.colorbox({iframe: true,href: elementURL,innerWidth: 645,innerHeight: 509});
              });
          });
       });
</script>

谢谢你。
a191387072 回答:如何在单击现有的 href 链接(wordpress)时打开灯箱?

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

大家都在问