I have a problem with creating accordions in my page where I'm using blogger API. I need to apply accordion format to a list of Blogger posts at http://www.winworldgk.tk , which are fetched using Blogger API. The problem is- I'm able to display all post contents and titles but are of general style not the required accordion style. Could any one there be help. The code is as bellow...
$(document).ready(function() {
// Make a JSONP request for the Posts on the Blogger Buzz blog
$.ajax({
url:"https://www.googleapis.com/blogger/v3/blogs/578441859855451483/posts?labels=EnglishTest&maxResults=5&key=mykey",
dataType: "jsonp",success: function(data, textStatus, jqXHR) {
var items = [];
// Construct a chunk of HTML for each post
// containing the Post title, content, and a
// link to the post author.
$.each(data.items, function(index, value) {
$('<h3><a href="#">'+value.title+'</a></h3><div>'+value.content+'</div>').appendTo("#accId");
}
});$("#accId").addClass("accordion");
}
});
});
<html>
<body>
<div id="accId"></div>
</body>
</html>