--- In [email protected], "alex_philippi" 
<[EMAIL PROTECTED]> wrote:
> Hi,
> I have to open a new window if I click on a "rect" Element. This
new 
> window must have custom width/height settings.
> 
> I tried it with javascript and then with the xlink statement. 
> Javascript don�t work ("window.open" dont open a new window) and 
with 
> the xlink (<a href xlink:"..." target=_blank > "rect" </a>) I could 
> only open a full size browser window.
> 
> Could someone give me a hint how I could realize this?
> Thnx :)

Hi,

I open a new window in certain situations from within SVG.  I
generate 
the SVG from a server app, and if the browser is IE then here is the 
way I open the new window:

<svg . . . >
. . .
. . .
</defs>
<script type="text/javascript"> 
<![CDATA[ 
        function newWindow( newURL ) {  
                wd=screen.availWidth;  
                ht=screen.availHeight;  
                attrributes = 'resizable,scrollbars,toolbar,height=' +
(ht*0.8)+ ',width=' +(wd*0.72) ;  
                attrributes += ',screenX=' + (wd*0.25) + ',screenY=' +
(ht*0.05)+',left=' + (wd*0.25) + ',top=' +(ht*0.05);  
                if (top) {  
                        top.open( newURL, "DDC", attrributes ).focus
();   
                } else {   
                    alert( "Cannot open a new window" );   
                }  
        }       
]]>  
</script>
<defs>

... 
...
... 

<g onclick="newWindow('http://abc.com/myapp/xyz.cgi?p1=123&p2=345');">
<a>
 <rect x="15" y="562" height="24" width="60" rx="1" fill="#EEEEEE" 
stroke="none"/>
</a>
</g>
...
...
</svg>

Note:
-  you can set the window size and position, etc., in the 'newWindow' 
function (I use a %age of screen width and height)
-  The <a> </a> is not required but is there simply so that the
cursor 
changes to a hand on mouseover (to indicate a link)
-  If using IE on Windows XP, with SP2 applied, then you may need to 
use the full url, eg. "http:// .....".  This is the case if the SVG
is 
displayed in an iFrame because since SP2 IE will block the new window 
and doesn't seem to recognise that a relative url used in the iFrame 
is still in the same domain (turning off the popup blocker doesn't 
help)
-  I can't remember the details but I think this didn't work with
ASV6 
+ Firefox, so when I detect Firefox v1.0 I use javascript directly in 
the <a>  as follows

<a 
xlink:href="javascript:wd=screen.availWidth;ht=scr
een.availHeight;newWi
n=top.open('http://abc.com/myapp/xyz.cgi?
p1=123&amp;p2=345','DispDocs','resizable,height='+(ht*0.6)+',width='+
(wd*0.6)+' ,screenX='+(wd*0.39)+',screenY=' +(ht*0.25)+',left='+
(wd*0.39)+',top='+(ht*0.25)+',scrollbars,toolbar' ); newWin.focus();">
<rect x="15" y="562" height="24" width="60" rx="1" fill="#EEEEEE" 
stroke="none"/>
</a>


hope this is some help

Richard




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