I have following to do the photo slideshow:
$('#Yeah').click(function() {
{% for photo in photos %}
$('#slideShow').append('<img src="/image?blob_key={{ photo }}" />');
% endfor %}
$('#slideShow').cycle({
fx: 'fade',
speed: 300,
next: '#slideShow',
timeout: 0
});
});
When I have empty img tag under the div tag, the slideshow won’t work at all.
<div id="slideShow">
</div>
However, if I at least add one img tag under the div tag, it works with the same codes.
<div id="slideShow">
<img class="pics" width="200" height="200">
</div>
Does anyone have any clue what’s the problem ? Any helps are appreciated.
I think that the problem is that the images are not fully loaded before the Cycle plugin is initialized.
Looking through the source of the “lite” version, I see:
Because you do not specify the
widthandheightoptions, it defaults to the width and height of the<img>element, which are both 0 when the image is not fully loaded.EDIT: Try:
EDIT2: There is a syntax error:
needs to be: