js/playscreen.js
changeset 23 933b388521f6
parent 22 4e1e66b2fdf1
child 24 b557f4bae85f
--- a/js/playscreen.js	Wed Apr 24 17:54:48 2013 +0200
+++ b/js/playscreen.js	Thu Apr 25 13:21:59 2013 +0200
@@ -426,8 +426,11 @@
 		
         $(".play-localtweets .tweet").each(function() {
         	var el = $(this),
-        		liY = + el.offset().top + el.outerHeight() / 2 - deltaY,
-        		t = +el.attr("data-timestamp"),
+        		liY = + el.offset().top + el.outerHeight() / 2 - deltaY;
+    		if (liY < 0 || liY > ph) {
+    		    return;
+    		}
+        	var t = +el.attr("data-timestamp"),
         		tY = localyscale * (t - localpos + localduration / 2),
                 tX = localL + lxscale * (data.fiveseconds[Math.floor(t / 5)].count - lmi);
     		ctx.beginPath();