javascript get image dimensions
var img = document.getElementById("myImageID");
var imgWidth = img.clientWidth;
var imgHeight = img.clientHeight;
javascript get image dimensions
var img = document.getElementById("myImageID");
var imgWidth = img.clientWidth;
var imgHeight = img.clientHeight;
Real image width with JavaScript
// width in pixels
function setImagesWidth(id, width)
{
var images = document.getElementById(id).getElementsByTagName("img");
var newWidth = width + "px";
for (var i = 0; i < images.length; ++i)
{
if (images[i].clientWidth > width)
{
images[i].style.width = newWidth;
}
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us