Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

trying to optimize picture preview for mobile

  • Loading branch information...
commit 699d16a4e587a9f7d308c712205fc85567c95bd4 1 parent 6527eed
@sukhada authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 reddit.js
View
10 reddit.js
@@ -197,8 +197,8 @@ function fixMargins() {
}
window.onload = function() {
- $("#img").css("max-width", $(window).width());
- $("#img").css("max-width", $(window).height());
+ $(".image").css("max-width", $(window).width());
+ $(".image").css("max-width", $(window).height());
console.log($(window).width());
if (localStorage.getItem('subreddits')) {
if (localStorage.getItem('lastItems')) {
@@ -290,11 +290,11 @@ $(document).on("mouseenter", "a", function(e) {
$("#img").append("<img class='image' src='"+ link +"'></img>")
}
else {
- console.log($(window).width());
$("#img").css("top", e.pageY - 10);
- $("#img").css("left", 0);
+ $("#img").css("left", 0);
$(this).css("color", "#05B8CC");
- $("#img").append("<img class='image' src='"+ link +"'></img>")
+ $("#img").append("<img class='image' src='"+ link +"'></img>");
+ console.log($(".image").css("width"));
setTimeout(function() {$("#img").empty();}, 3000);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.