Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript get image width and height

var img = new Image();
img.onload = function() {
  alert(this.width + 'x' + this.height);
}
img.src = 'http://www.google.com/intl/en_ALL/images/logo.gif';
Comment

get image src width and height

// for the original width and height in px of the source
image.naturalWidth, image.naturalHeight

// for the image size in px rendered on the screen
image.width, image.height
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript for in loop 
Javascript :: setProps jest 
Javascript :: prevent onclick event javascript 
Javascript :: toast 
Javascript :: javascript array push 
Javascript :: insert array as string google app scripts 
Javascript :: Vue 3 script setup props emits 
Javascript :: popper.js and jquery 
Javascript :: loop array of objects 
Javascript :: Uncaught TypeError: document.getContext is not a function 
Javascript :: get all parent nodes of child in javascript array 
Javascript :: handleClickoutside custom hook react 
Javascript :: animejs reduce the speed 
Javascript :: javascript limit number of lines in div 
Javascript :: js empty map 
Javascript :: javascript for loop[ 
Javascript :: express get 
Javascript :: datatable change classname by value 
Javascript :: ./node_modules/bootstrap/dist/js/bootstrap.bundle.js 
Javascript :: mongoose get value 
Javascript :: javascript swap images on mouseover 
Javascript :: sort by attribute in reactjs 
Javascript :: mongoose nested object without id 
Javascript :: discord.js reason 
Javascript :: invariant failed you should not use link outside a router test 
Javascript :: make 2div in row react js 
Javascript :: node-schedule job on specific datetime 
Javascript :: change array index position in javascript by up and down click 
Javascript :: remove index from array javascript 
Javascript :: salvar no localStorage react 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =