我在标题中使用此代码来显示我们的购物车。 目前,下拉列表显示在悬停状态。
如何修改此选项以便显示下拉列表onclick
?
<a href="#header-cart" class="skip-link skip-cart <?php if($_cartQty <= 0): ?> no-count<?php endif; ?>">
<span class="icon"></span>
<span class="label"><?php echo $this->__('Cart'); ?></span>
<span class="count"><?php echo $_cartQty; ?></span>
</a>
<div id="header-cart" class="block block-cart skip-content">
<?php echo $this->getChildHtml('minicart_content');?>
</div>
答案 0 :(得分:1)
使用此
<a href="#" class="skip-link skip-cart <?php echo $_cartQty <= 0 ? 'no-count' : ''?>">
$('a').on('click',function(){$(this).attr('href','#header-cart')});