diff options
author | MaZderMind | 2014-12-23 13:36:01 +0100 |
---|---|---|
committer | MaZderMind | 2014-12-23 13:36:01 +0100 |
commit | 10b5e9b9e2357755bc8e155c92a50206b80d27f7 (patch) | |
tree | 339d3021093f6fd38891666d7dfc7ee9eddeecbe | |
parent | 0d96b29d2fd96a5f32d98f63a55923a580f13f74 (diff) |
update teaser images every 10s
-rw-r--r-- | assets/js/lustiges-script.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js index f01c0e1..37e6838 100644 --- a/assets/js/lustiges-script.js +++ b/assets/js/lustiges-script.js @@ -392,3 +392,25 @@ $(function() { $('.feedback-thankyou').show(); }); }); + + +// update teaser images +$(function() { + setInterval(function() { + $('.rooms .lecture .teaser').each(function() { + var + $teaser = $(this), + $preload = $('<img />'), + src = $teaser.data('src'); + + if(!src) { + src = $teaser.prop('src'); + $teaser.data('src', src); + } + + $preload.on('load', function() { + $teaser.prop('src', $preload.prop('src')); + }).prop('src', src + '?'+(new Date()).getTime()); + }); + }, 1000*10); +}); |