From 9f39bd80e2560395428de81b789d4859ae3d364c Mon Sep 17 00:00:00 2001 From: Josh de Leeuw Date: Thu, 13 Feb 2014 11:03:30 -0500 Subject: [PATCH] closes #26 --- plugins/jspsych-vsl-animate-occlusion.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/jspsych-vsl-animate-occlusion.js b/plugins/jspsych-vsl-animate-occlusion.js index 54c5a06f69..3f4b0487c8 100644 --- a/plugins/jspsych-vsl-animate-occlusion.js +++ b/plugins/jspsych-vsl-animate-occlusion.js @@ -88,14 +88,17 @@ var i = trial.stims[which_image]; which_image++; + eve.once("raphael.attr.src."+c.id, function(){ + c.animate(d[0].params, d[0].ms, function() { + c.animate(d[1].params, d[1].ms, function() { + next_step(); + }); + }); + }); c.attr({ src: i }); - c.animate(d[0].params, d[0].ms, function() { - c.animate(d[1].params, d[1].ms, function() { - next_step(); - }); - }); + } }