I have sometimes noticed troubles using getBBox() in Firefox, but
didn't see anyone else fussing so I figured it was just me (this is
still a distinct possibility). However, the following example
(excerpted from http://srufaculty.sru.edu/david.dailey/svg/tiles.svg
in which tori are tiled with random four-regular pseudographs of
genus one -- for those with quirky interests) persuades me that
Firefox behaves a bit differently than I would expect many folks
would expect it to.
If I try to measure the size of a Big Rectangle (<rect id="BIGR"
x="0" y="0" height="100%" width="100%" fill="#eeddff"/>) upon loading
the svg tag (which contains onload="startup(evt);"), then Firefox
just gives up when it reaches the statement
svgright=BIGR.getBBox().width
(even though an alert(BIGR.id) just before it suggests the object is
present in the DOM). However if I delay the use of this measuring
method until after the user moves the mouse (as shown below) it works
just fine.
Is this as it should be? Also while evt.target.getBBox() works fine
to measure the screen in IE, the same thing does not seem to work in
FF, even though o=evt.target receives the assignment of attributes just fine.
David
function startup(evt) {
o=evt.target
o.setAttribute("onmousemove","dostuff()")
svgDocument = o.ownerDocument;
svgRoot = svgDocument.documentElement;
//don't put the next two statements in this function -- they don't work
//BIGR=svgDocument.getElementById("BIGR")
//svgright=BIGR.getBBox().width
}
function dostuff(){
o.setAttribute("onmousemove",null)
BIGR=svgDocument.getElementById("BIGR")
svgright=BIGR.getBBox().width
barheight=40
bottomedge=BIGR.getBBox().height - barheight
buttonBar=svgDocument.getElementById("buttonBar")
buttonBar.setAttribute("transform","translate(0,"+bottomedge+")")
buttonBar.setAttribute("height",barheight)
------------------------ Yahoo! Groups Sponsor --------------------~-->
1.2 million kids a year are victims of human trafficking. Stop slavery.
http://us.click.yahoo.com/.QUssC/izNLAA/TtwFAA/1U_rlB/TM
--------------------------------------------------------------------~->
-----
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/