Created
July 6, 2017 09:44
-
-
Save baladkb/60000e21b700497adc8f56538d72b2bb to your computer and use it in GitHub Desktop.
get Height / Width of image in JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var imageVal = urlVal+'/images/articulos-nuevo/'+siteVal+'/'+codigoAlfa+'/1-Z.jpg'; | |
var img = new Image(); | |
img.onload = function(){ | |
var height = img.height; | |
var width = img.width; | |
console.log("::: height "+height); | |
console.log("::: width "+width); | |
} | |
img.src = imageVal; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment