JSFiddle - React, Tailwind, and code Playground
by bingjie2680
JavaScript
var url = "http://www.gravatar.com/avatar/5e0ea9baaa2e521581209355fa7b4ce5?s=128&d=identicon&r=PG";
function checkimage(me) {
var img = new Image();
img.onload = imageready;
img.src = me;
}
function imageready(){
var ih = $("#image > img").height();
var iw = $("#image > img").width();
if(ih == 90 && iw == 728){
var style = "Leaderboard";
image.css({"border":"none", "height":"18px", "width":"326px", "outline-color":"#8F8F8F"});
}else if(ih == 600 && iw == 160){
var style = "wideskyscraper";
image.css({"border":"none", "height":"18px", "width":"326px", "outline-color":"#8F8F8F"});
}else{
allow = false;
image.css({"border":"1px solid #F00", "height":"16px", "width":"324px", "outline-color":"#F00"});
}
}
checkimage(url);