2012-05-05 77 views
0

我試過尋找這個答案,但我的搜索已空出來。很難甚至找出要搜索的術語。基本上我有什麼是產品清單。我有點擊圖片的功能,它會打開一個新選項卡,引導您進入外部鏈接,您可以在我的href中使用target = _blank購買產品。我還希望圖片可以直接轉到另一個內部鏈接,您可以在該鏈接中評論和評價產品,並在與原始頁面相同的選項卡中打開該鏈接(因此,您基本上必須反擊回到主要產品列表中。這是可以做到的,如果是怎樣? 先感謝您的任何指導。有一個html鏈接直接指向另一個頁面,並彈出另一個頁面

回答

3
<a href="url for new tab" target="_blank" 
    onclick="location.href = 'url for current tab'">Link</a> 
+0

這可能對我更好,因爲我更喜歡讓jscript控制內部鏈接和html控件新標籤頁 –

0

如果我理解正確的話,你想有一個鏈接重定向到一個頁面,打開一個彈出?你試過JavaScript的onclick

你可以這樣做:

<a href="thePage.html" onclick="window.open('thePopup.html')"><img src="myImage.png"/></a> 
1
<script type="text/javascript"> 
    function openpages() { 
window.open("http://google.com"); 
window.location = "http://yahoo.com" 
    } 
    </script> 
<a href=# onclick="openpages()">open product description</a> 

這將在同一個新的標籤和雅虎打開谷歌爲紐帶

0

它非常簡單,使用onclick處理器與href標籤相結合。

<a href="#yourinternallink" onclick="window.open('popup.html')"> 
    <img src="link/to/my/image.jpg" /> 
</a> 
相關問題