![]() |
"style" in "CreateElement"
Hi all! :) in "CreateElement" fails "style" attribute it just doesn`t change the "top" and the "left" of the new element.
Another thing is that in "displayHTML" i don't see the code of the new element. Anyone can help me, please?:confused: Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
Wow, navigator.appName? That is some ancient approach…
But anyway, your image dimensions need a unit: width: 50px; … height: 35px. And what do you think would this newImage.onload="style.top:100px;" do? You’re assigning a string to the onload event. I think you need something likeCode:
newImage.onload= function() {this.style.top = "100px";} |
And you should preferrably use the property notation instead of .setAttribute
Code:
newImage.src = "..."; |
Both of them do not work.:(
Code:
newImage.style = "position: absolute; left: 20px; width: 50px; top: 100px; height: 35px";thank you |
Yeah sorry my bad ... either you'll have to provide each style property in one separate line
Code:
newImage.style.position = "absolute";Code:
newImage.style.cssText = "position: absolute; left: 20px; width: 50px; top: 100px; height: 35px"; |
Quote:
|
| All times are GMT +1. The time now is 12:07 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.