2013-12-21 138 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