<button> Show </button>
<ol style="display:none;">
<?php foreach ($this->getItems() as $_item): ?>
<li>
<?php if ($_item->getCount() > 0): ?>
<a href="<?php echo $this->urlEscape($_item->getUrl()) ?>">
<?php echo $_item->getLabel() ?>
<?php if ($this->shouldDisplayProductCount()): ?>
<span class="count">(<?php echo $_item->getCount() ?>)</span>
<?php endif; ?>
</a>
<?php else: ?>
<span>
<?php echo $_item->getLabel(); ?>
<?php if ($this->shouldDisplayProductCount()): ?>
<span class="count">(<?php echo $_item->getCount() ?>)</span>
<?php endif; ?>
</span>
<?php endif; ?>
</li>
<?php endforeach ?>
</ol>
我有以下代码打印magento中的过滤器我想显示/隐藏过滤器。这会从过滤器打印多次按钮 - > ol过滤器按钮 - > ol。我想这样做:当我点击按钮时,我只想要第一个ol按钮后显示或隐藏。我需要帮助谢谢!JQUERY每个按钮之后的第一个元素
删除'php'代码,只写html结果。 – Mohammad