Friday 04 February 2011 5:03:29 am
hello, we have a crazy problem with for loop. in general we work with a template which build an video gallery. we use jq tooltip to dynamically display video content. whatever, everything works fine if the quantity of video items that we create in this "for loop" is < 21. if the quantity is >=21 the qj tooltip don't work as expected. the error: as you se we override the jq tooltip event "mouseenter, mouseleave" to " click, "" " this works as expected if our loop is < 21. if its >20 the mouseenter event comes back and we get a crazy mixture of both events. example code without video content. the example is reduced to the minimal code structure to reproduce our error.
{def $cols=5
$rows=8
$video_count=21
$field_count=40
$random_field_nrs=ssl_randomlist(0,$field_count|sub(1),$video_count)}
<div class="videoarea">
{def $video_index=0}
{for 0 to $field_count|sub(1) as $index}
{if and(lt($video_index, $video_count),
$random_field_nrs|contains($index))}
<div class="video">
previewimage
</div>
<div class="tooltip">
video {$index}
</div>
{set $video_index = $video_index|inc()}
{continue}
{/if}
{/for}
{undef}
<div class="clear"></div>
</div>
{literal}
<script type="text/javascript">
$jq(document).ready(function() {
$jq(".video").tooltip({
effect: 'slide',
events: { def: 'click, ',
tooltip: 'mouseover'
}
});
});
</script>
{/literal} greetings
|