I was trying to add a show more button or div as in this example here show more button to my jquery rss I made here Jquery rss feed. The problem is that I tried many times to wrap the rss div with a div wrapper and force it to display few lines only, but it didn't work...
so all I want is to hide all rss feeds except say top 3 only. Then whenever I want to show more of the feed threads, I simply click Show more button...
This is the show more button with javascript:
Jquery show button
for (var i = 0; i < 30; i++) {
$("ul").append("<li>" + i + "</li>");
}
var $li = $("li"),
chunk = 5;
console.log(chunk, $li);
$li.slice(chunk).hide();
$("button").click(function() {
$li.filter(":hidden").slice(0, chunk).show();
});
html show button
<ul></ul>
<button>Show more</button>
jquery rss:
$(document).ready(function () {
$('#test').rssfeed('http://feeds.reuters.com/news/artsculture/', {
limit:100
});
});
rss html:
<div id="test"></div>
any idea how I have to do in order to show only the first 3 or say 5 feeds and hide the rest. And display each 3 or 5 feed after clicking the show more button...??
Thanks