From 6219f116f895c5aedd312eb2f6f839be2a031d97 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Fri, 28 Feb 2014 13:42:59 -0800 Subject: [PATCH] Reduce jank This does not completely eliminate the jank. :( --- picsorter.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/picsorter.js b/picsorter.js index 24cc893..fd8a8dc 100644 --- a/picsorter.js +++ b/picsorter.js @@ -41,11 +41,13 @@ function setpic() { display_filename = zoom + files[input_index]; } var $pic = $("#pic"); + $pic.on("load", function() { + $pic.removeClass("rot90 rot180 rot270"); + if ("rotate" in picinfo[files[input_index]]) { + $pic.addClass("rot" + picinfo[files[input_index]].rotate); + } + }); $pic.attr("src", display_filename); - $pic.removeClass("rot90 rot180 rot270"); - if ("rotate" in picinfo[files[input_index]]) { - $pic.addClass("rot" + picinfo[files[input_index]].rotate); - } } function say(message) { -- 2.44.1