--- In [email protected], "ddailey" <[EMAIL PROTECTED]> wrote:
>
> 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.

Consider using e.g.
  svgEmbedElement.setAttribute('width', '400')
  svgEmbedElement.setAttribute('height', '400');
(where you get that svgEmbedElement with e.g.
  var svgEmbedElement = document.getElementById('S')
or e.g.
  var svgEmbedElement = document.embeds.embedName;
)
That 
<http://home.arcor.de/martin.honnen/svg/embedSizeChange1.html>
works for me here with Firefox 1.5.0.1, with IE6 and Adobe SVG viewer
3.0, and with Opera 9 build 8359 (a weekly build released a week ago).
If you still have problems with Opera 9 then check with the latest
weekly build you can get here <http://my.opera.com/desktopteam/> and
report back whether it works.

<http://my.opera.com/desktopteam/>


> 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/
 


Reply via email to