$(document).ready(function() { $("img").each(function(idx, elm){ $(elm).css("margin-bottom", elm.height * -0.333); }).on("load", function(e){ $(e.target).css("margin-bottom", e.target.height * -0.333); }); $(".back-button") .html("Go Back") .click(function(_) { window.history.back()}); if(navigator.userAgent.indexOf("Trident") > -1) { console.log(navigator.userAgent); $(".search-icon").css("display", "none"); } });