<a href=" "> not working</a>

时间:2013-12-21 23:22:50

标签: html browser anchor href

以下超链接不起作用,但是当您在新标签按钮中单击“打开”时,它可以正常工作。

<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>

我尝试过使用Chrome和Firefox。可以看到实时页面here

2 个答案:

答案 0 :(得分: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;会阻止链接触发。

答案 1 :(得分: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