Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

trying to optimize picture preview for mobile

  • Loading branch information...
commit 3b105eaf04b9a17a0eb626777491c84f94b18a05 1 parent 699d16a
@sukhada authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 reddit.js
View
5 reddit.js
@@ -1,3 +1,4 @@
+var t;
var count;
var counts = [];
var result1 = [];
@@ -278,6 +279,8 @@ $("#clear").click(function() {
$(document).on("mouseenter", "a", function(e) {
var link = $(this).attr('href');
+ clearTimeout(t);
+ $("#img").empty();
if (link != undefined) {
if (($(this).attr('href').indexOf("i.imgur") != -1) ||
($(this).attr('href').indexOf("jpg") != -1) ||
@@ -295,7 +298,7 @@ $(document).on("mouseenter", "a", function(e) {
$(this).css("color", "#05B8CC");
$("#img").append("<img class='image' src='"+ link +"'></img>");
console.log($(".image").css("width"));
- setTimeout(function() {$("#img").empty();}, 3000);
+ t = setTimeout(function() {$("#img").empty();}, 3000);
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.