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

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -