I got rather stuck with what I thought should have been fairly easy. I
wanted to put an SVG object in a web page and then resize it upon loading
the web page and maybe manipulate it again later, as well.
<html><head><script>function resize(){ [...]}</script><body
onload="resize()"><embed id="S" src="some.svg">
is basically the setup.
In the function resize, I do a basic screen-model-detect that works in
Opera9, FF1.5, and IE/ASV.
Let's say w is the width of the screen. If I try to do
document.getElementById("S").width=w this works in IE and FF, but is
ignored in Opera.
If I try using style.width instead, then Opera misbehaves rather
dramatically and refuses to see the embed afterwards and will continue
refusing even after I reset the code to the way it used to be. It has a very
persistent memory of my transgression.
If I try building the embed tag and appending it to the HTML DOM via
something like
E=document.createElement("embed")
E.setAttribute("width", rightedge)
E.setAttribute("src", "grid.svg")
document.body.appendChild(E)
or if I use the more pedestrian
document.getElementById("Q").innerHTML="<embed src='grid.svg'
width='"+rightedge+"' height='"+bottomedge/2+"'>" to put it in a HTML div
tag with id="Q"
then IE and Opera are happy, but FF just gives up.
Any suggestions? I know I can declare the <embed> to have a width of 100%,
but how to programmatically change this in all three browser environments?
DD
-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
----
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/