/* ====================================================================== LOAD IN TODAYS DEALS ====================================================================== */ function populateToday(){ $.each(deals_today, function(i, deal){ // increment i by one (starts at 1 instead of 0) i++; var item = renderCapsule(i,deal); // add our item to todays deals item.appendTo(todaysDeals); // push this in to our "allDeals" array for the big slider allDeals.push(deal); }); } /* ====================================================================== LOAD IN YESTERDAYS DEALS ====================================================================== */ function populateYesterday(){ $.each(deals_yesterday, function(j, deal){ // increment i by one (starts at 1 instead of 0) j++; var item = renderCapsule(j,deal); // add our item to todays deals item.appendTo(yesterdaysDeals); // push this in to our "allDeals" array for the big slider allDeals.push(deal); }); } /* ====================================================================== CAPSULE RENDERING FUNCTIONS these render the small boxes ====================================================================== */ // renders a capsule containing item image and title function renderCapsule(j,deal){ var image = deal.capsule; var title = deal.name; var item = $("
"); item.attr("data-num", dealCount); dealCount++; item.append(""+title+""); return item; }