I have this code successfully pulling images from Behance using Jquery Json:
$('a.link').live('click', function () {
h = window.location.hash.replace('#', '');
$.getJSON("http://www.behance.net/v2/projects/" + h + "?api_key=" + api + "&callback=?", function (data) {
var project_data = "";
for (var i = 0; i < data.project.modules.length; i++) {
if (data.project.modules[i].type == "image") {
project_data += '<img src="' + data.project.modules[i].src + '" />';
}
if (data.project.modules[i].type == "text") {
project_data += '<p>' + data.project.modules[i].text + '</p>';
}
};
$('.portfolio-details h3').html(data.project.name);
$('.portfolio-details div').html(project_data);
$('.portfolio-details').fadeIn(6000);
});
});
they are pulling into the page, and currently showing as individual images. But how would I wrap all the images together in this code to make a slideshow? each image text represents where the image needs to be added
<div id="myCarousel" class="carousel slide">
<div class="carousel-inner">
<div class="item"> each image </div>
<div class="item"> each image </div>
</div>
</div>
Why can’t you prepend/append the html you need to the
var project_data = "";variable?EDIT:
Here is a simple way to approach this.