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
Post a Comment