2013-12-21 137 views
2

The following hyperlink does not work, though it works when you click open in new tab button.<a href=" "> not working

<div class="span12 category-products" style="margin: 0 auto;"> 
<div class="toolbar"> 
    <div class="row big_with_description" style="position:relative;">                 
     <a href="http://www.grewal.nl/reviveme/repair/mobile.html"> 
      <div class="span5 product hover"> 
       <img src="http://www.grewal.nl/reviveme/media/catalog/category/mobile2.jpg" class="category-thumbnail product-retina" width="499" height="268" alt="Mobile">  
      </div> 
     </a> 
    </div> 
</div> 

I have tried using Chrome and Firefox. The live page can be seen here

+0

您的定位標記已摺疊,即它們沒有尺寸。嘗試將寬度和高度應用於它們或使用'display:inline-block'。 – 2013-12-21 23:25:02

回答

6

如果禁用鏈接起作用的JavaScript。在ajaxtoolbar.js你有下面的代碼:

$jq('a','.toolbar').click(function(event) { 
    link = $jq(this).attr('href'); 

    if((link.search("mode=")!=-1||link.search("dir=")!=-1||link.search("price=")!=-1||link.search("p=")!=-1)&&(toolbarsend==false)){ 
     event.preventDefault(); 
     ajaxtoolbar.onSend(link,'get'); 
    } 

    return false; 

}); 

return false;防止觸發的鏈接。

+0

謝謝。你能告訴我,你是怎麼發現的? – progit

+1

我看到了工具欄類,並在源代碼中查找名稱爲「toolbar」的任何腳本。由於該鏈接在新窗口中運行,我的猜測是這是一個JavaScript問題。 – Kaloyan

1

像@Benjamin Gruenbaum說,試試這個:

<div class="span12 category-products" style="margin: 0 auto;"> 
    <div class="toolbar"> 
    <div class="row big_with_description" style="position:relative;"> 
     <div class="span5 product hover">           
     <a href="http://www.grewal.nl/reviveme/repair/mobile.html"> 
     <img src="http://www.grewal.nl/reviveme/media/catalog/category/mobile2.jpg" class="category-thumbnail product-retina" width="499" height="268" alt="Mobile"> 
     </a> 
     </div> 
    </div> 
    </div> 
</div> 

如果這是你打算用這個div鏈接,我想引用這篇文章:「Make a div into a link

+0

對不起,剛試過那個在live頁面上,沒有用 – progit