我想在我的主页上显示前两部分,然后当用户点击"SHOW MORE NEWS“时,前两条新闻消失,另外两条我隐藏的新闻出现。有没有可能用jCarousel制作幻灯片?因为我试过很多方法都没成功。它更好地使用其他插件通过幻灯片内容部分?
导入jQuery库
<script type="text/javascript" src="jcarousellite_1.0.1.min.js"></script>
<script type='text/javascript' src='//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js?ver=1.9.1'></script>HTML:
<div id="news-content">
<h1>News</h1>
<hr/>
<div id="firstnews">
<article id="loop-news">
<img src="image1.png" />
<a href="#">Title 1</a>
<p>Text Title 1</h3>
</article>
<article id="loop-news">
<img src="image2.png" />
<a href="#">Title 2</a>
<p>Text Title 2</p>
<h3>Read more</h3>
</article>
</div>
<!-- Just want to show this articles below when click on "SHOW MORE NEWS" -->
<div id="secondnews">
<article id="loop-news">
<img src="image1.png" />
<a href="#">Text only show</a>
<p>Text Title 1</h3>
</article>
<article id="loop-news">
<img src="image2.png" />
<a href="#">Title 2</a>
<p>Text Title 2</p>
<h3>Read more</h3>
</article>
</div>
<hr/>
<a href="#" id="nextBtn">SHOW MORE NEWS(+)</a>
</div>
Jquery:
<script type="text/javascript">
$(document).ready(function() {
$("news-content").jCarouselLite({
btnPrev: "#nextBTN",
visible: 1
})
});
</script>发布于 2014-03-05 02:48:48
我也有同样的问题,我认为jcarousel只适用于图像。可能Bj内容滑块正是您需要的http://www.byjoomla.com/joomla-extensions/content-slider
https://stackoverflow.com/questions/22177802
复制相似问题