我正在使用这个 jQuery 图腾插件https://github.com/buildinternet/totem
我的代码:
JavaScript
<script type="text/javascript">
$(function(){
$('#newslistul').totemticker({
row_height : '34px',
max_items : 1
});
});
</script>
HTML
<!-- Start News Bar -->
<section id="news">
<div class="container">
<p>EV.news</p>
<div id="newslist">
<ul id="newslistul">
<li><a href="#" title=""><i class="fa fa-angle-right fa-lg" style="margin-right: 4px;"></i> May 25, 2010 Cras sodales augue a nulla tincidunt tincidu sce congue massa enim consequt nonummy</a></li>
<li><a href="#" title=""><i class="fa fa-angle-right fa-lg" style="margin-right: 4px;"></i> Apr 25, 2010 Vivamus sollicitudin erat ut turpis convallis eleife</a></li>
<li><a href="#" title=""><i class="fa fa-angle-right fa-lg" style="margin-right: 4px;"></i> Sept 25, 2010 Cras sodales augue a nulla tincidunt tincidu sce congue massa enim consequt nonummy</a></li>
<li><a href="#" title=""><i class="fa fa-angle-right fa-lg" style="margin-right: 4px;"></i> Sept 25, 2010 Headline lorem ipsum dolor sit amet, consectetur adipiscing elitc vamus id mauris eu mi rutrum tempus</a></li>
</ul>
</div><!-- /.newslist -->
<a href="#" id="news"><i class="fa fa-plus-square" style="position: relative; top: -8px; color: grey;"></i></a>
</div><!-- /.container -->
</section>
<!-- End News Bar -->
我想要下一个:当你点击
<a href="#" id="news"><i class="fa fa-plus-square" style="position: relative; top: -8px; color: grey;"></i></a>
链接,ul 列表以展开并显示所有 4 li。变量row_height: '34px'
,并且max_items:1
应该将值更改为 row_height : '130px'
,然后max_items: 4
单击链接 a href 并在同一次单击时返回 1 。