Hi all,

      i am new to this group and also to the svg. i am doing an AJAX
application n want to use SVG for front end while ajax handles client
side requests.

1. my first doubt is about plcaing an svg shape say circle at the
middle of the browser depending on the resolution of what ever PC i
run the program.


--------> here i am embeding the svg with 100% (INDEX.html)

<body scroll="no">
       <embed src="WorldView.svg" type="image/svg+xml" width="100%"
height="100%
"pluginspage="http://www.adobe.com/svg/viewer/install/main.html";>
 </body>



--------------> here when i load the svg document the Init javascript
function is called (WorldView.svg)


<svg xmlns="http://www.w3.org/2000/svg"; onload='Init(evt)'>



---------------------------------> here i am getting screen width n
height n placing the circle at the center. But in IE its not appearing
at the center of browser window, but when i press F11 windows key its
appearing center any comments. (Client.js)

THIS CODE is in INIT function

var w = screen.width;
   var h = screen.height;
   var wrld;
   
   wrld = "WORLD";
   
   CX = w/2;
   CY = h/2;
   
   var anchorEl = SVGDocument.createElementNS(svgNS, 'a');
   
   anchorEl.setAttributeNS(null, 'id', 'mydiv1');
   
   var circleEl = SVGDocument.createElementNS(svgNS, 'circle');
   
   circleEl.setAttributeNS(null, 'cx', CX);
   circleEl.setAttributeNS(null, 'cy', CY);
   circleEl.setAttributeNS(null, 'r', '20');
   circleEl.setAttributeNS(null, 'fill', 'yellow');
   circleEl.setAttributeNS(null, 'stroke', 'blue');
   circleEl.setAttributeNS(null, 'stroke-width', '2');
   circleEl.setAttributeNS(null, 'onclick', 'OnMouseClick(' + wrld + ')');
   
   var titleEl = SVGDocument.createElementNS(svgNS, 'title');
   var titleText = SVGDocument.createTextNode(wrld);

   titleEl.appendChild(titleText);
   circleEl.appendChild(titleEl);
   anchorEl.appendChild(circleEl);
   SVGRoot.appendChild(anchorEl);



2. my second question is when i sent the onclick attribute of the
circle shape in SVG by passing a WORLD value to the OnMouseClick
function i am getting 'WORLD' but not WORLD as expected and its saying
'WORLD' is undefined.

how to pass values to function while setting onclick attributes in
javascript like this.


3. Does any one knows good editor for both javascript and SVG.


4. as i said earlier i am creating the circle at the center of browser
window or viewport.

Suppose if resolution is 1027, 768 then the CX, CY of the circle would
be (512,384). lets suppose the circle is of radius 20.

Now i want to place some circles around this circle when the radius of
the original circle is like 80.

i am using the following formula to generate the points on this new
outer circle

CX1 = CX + r`*Math.cos(angle) r`=80 angle may be from 0-360
CY1 = CY + r`*Math.sin(angle)


but when i generate new x,y like this the points are not coming
exactly at desired positions. i think due to float values. can anyone
have an idea of exact formula to place circles at diff positions of
outer circle.

i will be happy to hear some suggestions in this,

byee,
pramod.












------------------------ Yahoo! Groups Sponsor --------------------~--> 
Home is just a click away.  Make Yahoo! your home page now.
http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/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/
 



Reply via email to