Skip to content

Instantly share code, notes, and snippets.

@gterrill
Created June 10, 2013 21:16
Show Gist options
  • Save gterrill/5752385 to your computer and use it in GitHub Desktop.
Save gterrill/5752385 to your computer and use it in GitHub Desktop.
Rendering the product image in the calendar page
eventRender: function(event, element) {
if (event.bookingCount >= event.capacity) {
element.addClass('booked-out');
}
var image = event.image.split('?')[0],
index = image.lastIndexOf('.'),
ext = image.substr(index),
path = image.substr(0, index),
div = $('<div>', {'class': 'thumb'}),
img = $('<img>', {'src': path + "_small" + ext});
element.find('.fc-event-inner').append(div.append(img));
}
/* CSS
#bta-calendar {font-size:12px; margin:5px 0}
#bta-calendar .fc-grid .fc-day-number {width: 96%; background: #eee; text-align: right;}
#bta-calendar .thumb {text-align:center; height:100px;}
#bta-calendar .thumb img {min-width:75px; min-height: 75px}
#bta-calendar .fc-event {border: 0 none}
#bta-calendar .fc-event-inner {padding:3px}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment