detect all image sizes on page with javascript -


i trying write javascript, allow me scan page , search specific image sizes , outline said image in red. example: want find instances of images 50x50px or 65x65px , outline them.

var images = document.getelementsbytagname('img');  var img; for(var = 0; < images.length; i++) {   img = images[i];   if ((img.clientwidth == "_whatyouwant_") && (img.clientheight == "_whatyouwant_")) {       img.classname = img.classname + " hightlight";   } } 

we take images, check size , if it's equal whatyouwant apply class defines additional style.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -