});
$waveform.find('span.done:last').addClass('current');
});
+
+ $('.gallery').each(function() {
+ var $gallery = $(this);
+ $gallery.find('span').on('click', function() {
+ $gallery.find('div.first img').attr('src', $(this).data('image-large'));
+ $gallery.find('div.first').show('fade');
+ return false;
+ });
+ $gallery.find('div.first').on('click', function() { $(this).toggle('fade'); return false; });
+ });
+
});
<div class="gallery" id="gallery-{{cell.id}}">
{% for image in cell.image_set.all %}
{% if forloop.first %}
-{% thumbnail image.image "640x480" crop="50% 25%" as im %}
<div class="first" style="display: none;">
-<img src="{{ im.url }}"/>
+<img src="#"/>
</div>
<div>
-{% endthumbnail %}
{% endif %}
{% thumbnail image.image "200x100" crop="50% 25%" as im %}
{% thumbnail image.image "640x480" crop="50% 25%" as im_large %}
{% endfor %}
</div>
</div>
-<script type="text/javascript">
-$(function() {
- var $gallery = $('#gallery-{{cell.id}}');
- $gallery.find('span').on('click', function() {
- $gallery.find('div.first img').attr('src', $(this).data('image-large'));
- $gallery.find('div.first').show('fade');
- });
- $gallery.find('div.first').on('click', function() {
- $(this).toggle('fade');
- });
-});
-</script>