开发者

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

开发者 https://www.devze.com 2023-02-02 02:16 出处:网络
I am trying to show an image of a specified height and width. Heres the code that I am using: function showpic(var1)

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&g开发者_如何学Got;<img src=\""+var1+"\" align=\"bottom\" width=\"400\" 
    height=\"300\" /></span> "; 

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

where var1=absolute link of the image

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号