Response title
This is preview!
<script type="text/javascript">
var links = ["A.html", "B.html", "C.html"];
var titles = ["titleA", "titleB", "titleC"];
var temp = "<a href='{link}' ><div class='cell' style='width:{width}px; height: {height}px; background-image: url(grid-images/photo/{index}.jpg)'><div class='showOnHover'>{title}</div></div></a>";
var w = 280, h = 320, html = '', limitItem = 15;
for (var i = 0; i < limitItem; ++i) {
html += temp.replace(/\{height\}/g, h).replace(/\{width\}/g, w).replace("{index}", i + 1).replace("{link}", links[i]).replace("{title}", titles[i]);
}
$("#freewall").html(html);
var wall = new freewall("#freewall");
wall.reset({
selector: '.cell',
animate: true,
cellW: 280,
cellH: 320,
onResize: function() {
wall.refresh();
}
});
wall.fitWidth();
// for scroll bar appear;
$(window).trigger("resize");
</script>
© 2013 jQuery Foundation
Sponsored by and others.