var padmaLists = [] $(document).ready(function() { callPadma("/list/get", initLists); }); var padmaList = function(json) { this.listId = json.listId; this.description = json.description; this.iconId = json.iconId; this.iconPath = "http://pad.ma/" + this.iconId + "/poster.jpg"; this.title = json.title; this.html = this.getHtml(); this.init(); } padmaList.prototype.init = function() { var that = this; $('#lists').append(that.html); } padmaList.prototype.getHtml = function() { var that = this; var wrapperElem = $("
"); wrapperElem.addClass("listWrapper"); var titleElem = $(''); titleElem.attr("id", this.listId); titleElem.addClass("listTitle"); var titleHtml = "" + this.title + ""; console.log(titleHtml); titleElem.html(titleHtml); titleElem.hover(function() { $(this).next().show(); }, function() { $(this).next().hide(); }); wrapperElem.append(titleElem); var innerElem = $(''); innerElem.addClass("listDetail"); innerElem.hide(); var innerHtml = ''; innerHtml += "