简体   繁体   English

使用setInnerXHTMl或FBML显示具有指定高度/宽度的图像

[英]using setInnerXHTMl or FBML to show image with specified height/width

I am trying to show an image of a specified height and width. 我正在尝试显示指定高度和宽度的图像。 Heres the code that I am using: 这是我正在使用的代码:

function showpic(var1)
{
    piclink="<span><img src=\""+var1+"\" align=\"bottom\" width=\"400\" 
    height=\"300\" /></span> "; 

    document.getElementById('big_pic').setInnerXHTML(piclink);
}

where var1=absolute link of the image 其中var1 =图片的绝对链接

The problem is, the height/width is getting sanitized (read removed). 问题是,高度/宽度已被清理(读取已删除)。 What can I do ? 我能做什么 ? Please let me know. 请告诉我。 Thanks. 谢谢。

- ahsan -阿三

solved using : 解决使用:

myimg = document.getElementById('img_tag');
myimg.setStyle({height: '300px', width: '400px'});

thanks 谢谢

- ahsan -阿三

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM