0

I have to show Images selected in File Upload conrtor before Submitting to the page.

Here is my code

CSS

 .upld
   {
    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);            
   }

HTML

    <input type='file' onchange="getIt(this,'divImgTop1')" /> <br /> 
    <div class="upld" id="divImgTop1"></div>

javascript

function getIt(t,id) {                       
       var divShw = document.getElementById(id);          
       divShw.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = t.value;         
       divShw.style.width = "100px";
       divShw.style.height = "100px";
     }

code is working fine and the image gets displayed.

Question How can i find the height of the image displayed ?

Kunj
  • 1,980
  • 2
  • 22
  • 34
Nuwan Dammika
  • 587
  • 9
  • 20

1 Answers1

0

we need only to make position:absolute on each div

then

$('#divImgTop1').height()

will give the height of the image :)

Nuwan Dammika
  • 587
  • 9
  • 20