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&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
精彩评论