在DXImageTransform.Microsoft.AlphaImageLoader之后获取图像高度 [英] Get image height after DXImageTransform.Microsoft.AlphaImageLoader

查看:51
本文介绍了在DXImageTransform.Microsoft.AlphaImageLoader之后获取图像高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码



CSS

  .upld 
{
过滤器:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod =图像);

HTML

 < input type ='file'onchange =getIt(this,'divImgTop1')/> < br /> 
< div class =upldid =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;
}

代码工作正常,图像显示。



问题
我如何找到显示图片的高度?

解决方案

我们只需要在 div 上设置 position:absolute

然后

  $('#divImgTop1')。height )

会给图像的高度:)

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 ?

解决方案

we need only to make position:absolute on each div

then

$('#divImgTop1').height()

will give the height of the image :)

这篇关于在DXImageTransform.Microsoft.AlphaImageLoader之后获取图像高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆