2016-02-29 28 views

回答

0

裏面你<a>標籤,你可以添加target="_blank"做到這一點。

4

找到你的錨鏈接到你的WP模板,應該是這樣的

<a href="http://your_url_here.html">Link</a> 

添加target="_blank"所以它看起來像:

<a target="_blank" href="http://your_url_here.html">Link</a> 
+0

任何空間,我想這樣的'如果(的getCookie( 'C')= 1!) \t \t { \t \t window.location.href = 「https://開頭鏈接」 代碼; \t \t setCookie方法( 'C',如圖1所示,24 * 60 * 60 * 1000); \t \t}'但我不明白的地方,我怎麼把這個@Jorel Amthor – adder69

+0

@ adder69這麼加呢?這實際上是最基本的HTML。 –

+0

@ adder69它litterally沒有意義。 PS:不要點擊這個鏈接,它會重定向到色情片。 –

0

在問題的標題,他提任何地方,其衍生以下解決方案

<!doctype html> 
<html> 
<head> 
    <title>This is the title</title> 

    <script type="text/javascript"> 
     function mainWindowLoaded() 
     { 
      console.log("Main windwo is loaded"); 
      document.getElementById('wholebody').addEventListener('click', clickedInBody); 
     } 

     function clickedInBody() 
     { 
      console.log("log added"); 
      window.open('https://www.google.com', '_blank'); 
     } 
     window.addEventListener('load', mainWindowLoaded); 
    </script> 
</head> 


<body > 

    <div 
     id='wholebody' 
     style="background-color:rgba(255, 0, 255, 0.3); position:absolute; top:0px; left:0px; width:100%; height:100%; z-index:1"> 

    </div> 

    <h1> Your website content goes here </h1> 

</body> 

這裏的關鍵思想是增加覆蓋DIV其中z-index比整個頁面含量越高。一個click行動被添加到這個div,它靜靜地捕捉所有的點擊事件。

+0

是否滿滿您的要求? @ adder69 –

相關問題