On Wed, 10 Dec 2008 13:12:18 +0100, markelliott2000 <[EMAIL PROTECTED]> wrote:
...
> include.js
> ----------
>
> function zoomin(x, y, width, height)
> {
> var vb = document.documentElement.getAttribute("viewBox");
> var vp_w = 0;
> var vp_h = 0;
>
> if(vb)
> {
> var vba = vb.split(" "); //comes out with four string array
> vp_w = Number(vba[2]);
> vp_h = Number(vba[3]);
> }
It's better to use the viewBox property:
var vb_w = document.documentElement.viewBox.baseVal.width;
var vb_h = document.documentElement.viewBox.baseVal.height;
And note that the viewBox isn't the same as the viewport.
Except for currentScale, there's also a currentTranslate property that you can
modify.
Cheers
/Erik
--
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed
------------------------------------
-----
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/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/svg-developers/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> 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/