Skip to content

Commit

Permalink
trying to optimize picture preview for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name Here committed Mar 15, 2013
1 parent 6527eed commit 699d16a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions reddit.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ function fixMargins() {
} }


window.onload = function() { window.onload = function() {
$("#img").css("max-width", $(window).width()); $(".image").css("max-width", $(window).width());
$("#img").css("max-width", $(window).height()); $(".image").css("max-width", $(window).height());
console.log($(window).width()); console.log($(window).width());
if (localStorage.getItem('subreddits')) { if (localStorage.getItem('subreddits')) {
if (localStorage.getItem('lastItems')) { if (localStorage.getItem('lastItems')) {
Expand Down Expand Up @@ -290,11 +290,11 @@ $(document).on("mouseenter", "a", function(e) {
$("#img").append("<img class='image' src='"+ link +"'></img>") $("#img").append("<img class='image' src='"+ link +"'></img>")
} }
else { else {
console.log($(window).width());
$("#img").css("top", e.pageY - 10); $("#img").css("top", e.pageY - 10);
$("#img").css("left", 0); $("#img").css("left", 0);
$(this).css("color", "#05B8CC"); $(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); setTimeout(function() {$("#img").empty();}, 3000);
} }
} }
Expand Down

0 comments on commit 699d16a

Please sign in to comment.