2 <div class="gallery" id="gallery-{{cell.id}}">
3 {% for image in cell.image_set.all %}
5 {% thumbnail image.image "640x480" crop="50% 25%" as im %}
7 <img src="{{ im.url }}"/>
8 <span>{% if image.title %}{{ image.title }}{% endif %}</span>
10 <div> {# extra opened <div> #}
13 {% thumbnail image.image "60x60" crop="50% 25%" as im %}
14 {% thumbnail image.image "640x480" crop="50% 25%" as im_large %}
15 <span data-image-large="{{ im_large.url }}"><img src="{{ im.url }}"
16 {% if image.title %} title="{{image.title}}" {% endif %}/></span>
21 </div> {# close extra <div> #}
25 <script type="text/javascript">
27 var $gallery = $('#gallery-{{cell.id}}');
28 $gallery.find('span').on('click', function() {
29 $gallery.find('div.first img').attr('src', $(this).data('image-large'));