Hi,
the best advice I can give is : always trust what Robert says.
It works with the transform attribute :
$('rect').attr('transform', "translate("+ (Math.sin(i+=.01)*100+100) + ")");
Best regards,
Yannick
- Mail original -
De: "Yang Zhang"
À: svg-developers@yahoogroups.com
Envoyé: Lund
Hi,
just put your code at the end or wrap it in an "onload" function.
Cheers,
Yannick
- Mail original -
De: "PETER"
À: svg-developers@yahoogroups.com
Envoyé: Vendredi 1 Février 2013 18:16:23
Objet: [svg-developers] getElementById -problem in Firefox - works in IE with
Adobe PlugIn
Thanks Erik, I had foolishly never thought it would work so simply with
responseXML.
Pranav, I think the best way is to get rid of embed or object tags. Then you
can access easily every HTML and SVG elements :
var svg = document.querySelector('svg');
var div = document.querySelecto
Hi,
personally, since it's possible in modern browsers, I would put the svg
directly in html.
And you can load and parse your file with an ajax call :
var r = new XMLHttpRequest();
r.open("GET", "myFile.svg",true);
r.onreadystatechange = function () {
if (this.readyState != 4 || this.status !
Hi,
why don't you just use css and pseudo class ":hover" ?
To do more stuff with javascript and "use" elements, I use this test :
var target = evt.target;
if (!target.parentNode && target.correspondingUseElement) { target =
target.correspondingUseElement; }
So it works with Chrome and IE.
Yanni
Hi all,
maybe I'm naive, but I just discover that the canvas html element could draw
svg files in one line of code.
See the live example : http://ybochatay.fr/svg2png.htm
The first butterfly is the original svg file, the second is the image drawn
with canvas.
Then you can easily export it to png
Hi Barkha,
the getScreenCTM method will help you
(http://www.w3.org/TR/SVG/types.html#__svg__SVGLocatable__getScreenCTM).
I wrote a little example : http://jsfiddle.net/ybochatay/aUYay/
by clicking in the svg area you'll get the coordinates of your mouse relatively
to the specified viewbox.
Regar
Hi,
I agree with Jason, javascript is the most promising way, the only one which
will work on all platforms without any plugin.
Yannick
- Mail original -
De: "Jason Barnabas"
À: svg-developers@yahoogroups.com
Envoyé: Mercredi 13 Juin 2012 08:22:28
Objet: Re: [svg-developers] Preferred wa
I've worked on a library with zoom and pan features :
http://ybochatay.fr/CariSVG/
It works fine but I won't maintain it : I'm completely rewriting it with a
wrapper (instead of working with prototypes), a better API and in a way to get
autocompletion in Eclipse.
Here's a first draft for mousewh
no API, countless global variables, browser sniffing, etc, to my mind SVGPan is
not a good choice.
But it's short and standalone so it can help to understand how a zoom can work.
Yannick
- Mail original -
De: "jamesd"
À: svg-developers@yahoogroups.com
Envoyé: Mercredi 6 Juin 2012 22:33:
Hi Manfred,
you only need to test if the method exists :
var myElmt = document.getElementById('myElmt');
var box;
if (myElmt.getScreenBBox) {
box = myElmt.getScreenBBox();
} else {
/* fallback */
}
Cheers,
Yannick
- Mail original -
De: "Manfred Staudinger"
À: svg-developers@y
Hi Manfred,
getBBox and getScreenCTM are implemented in all modern browsers (IE>=9).
Unfortunately there's no ideal workaround for getScreenBBox, as you can read
here :
http://groups.google.com/group/lib-gwt-svg/browse_thread/thread/1560b1282433fbd5
The simpliest is probably to use the getBoundin
Hi,
you'd better use the transform property of the SVG DOM elements.
Here is a little function to get the angle properly :
http://jsbin.com/usopay/edit#javascript,html
Yannick
- Mail original -
De: "svgdeveloper"
À: svg-developers@yahoogroups.com
Envoyé: Dimanche 20 Mai 2012 13:41:11
Obj
Hi Chris,
All you can do is dealing with the HTML5 history API, but you can't really stop
the back button, and it's not advisable.
https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history
Yannick
- Mail original -
De: "Chris Peto"
À: svg-developers@yahoogroups.com
Envoyé: Ma
Hi Ben,
since the getBBox method returns a SVGRect object, it's only few lines of
javascript to create/update a rect element behind your text element, no math
and you can go shopping.
function setText(textElmt,str) {
textElmt.textContent = str;
var box = textElmt.getBBox();
var rect = d
Hi,
if all your shapes are included in a g element, you can use the getBBox method
on this node to get the dimensions.
In your example :
document.getElementById('G2').getBBox()
Yannick
- Mail original -
De: "Alireza"
À: svg-developers@yahoogroups.com
Envoyé: Jeudi 5 Avril 2012 10:19:19
Hi James,
you can use window.scrollTo(0,0).
https://developer.mozilla.org/en/Window.scrollBy
https://developer.mozilla.org/fr/DOM/window.scrollTo
Yannick
- Mail original -
De: "jamesd"
À: svg-developers@yahoogroups.com
Envoyé: Vendredi 6 Avril 2012 01:43:11
Objet: [svg-developers] Revers
I think you mix the order of the arguments :
C x1,y1 x2,y2 x,y
in "c1", the second control point is 105,55 and the current point 105,55 too.
So the reflection is 105,55.
I guess the correct code is :
Cheers,
Yannick
- Mail original -
De: "philsvg"
À: svg-developers@yahoogroups.com
Bonjour Philippe,
you have a syntax error in "c2" : "S 200,100 200,55 200,55" is not valid.
In "c4", in the "S" segment the first control point is the reflection of the
last one :
in your case the last control point is "150,10", the current point is
"150,100", so the reflection is "150,190" and n
Hi Ruth,
is the getPointAtLength method what you're looking for ?
http://www.w3.org/TR/SVG/paths.html#InterfaceSVGPathElement
Yannick
- Mail original -
De: "Ruth Lang"
À: svg-developers@yahoogroups.com
Envoyé: Vendredi 3 Février 2012 17:42:56
Objet: [svg-developers] markerline symbol
Hi,
your variables are declared as global, so when you call the init function a
second time, they are overwritten.
Just move these variables and functions inside the Init constructor and it will
be fine (see below).
Yannick
function Init(anchor) {
var SVGRoot = null;
var
Hi Aron,
just change the input type to "button", cause "submit" will reload the page.
Yannick
- Mail original -
De: "aronsta"
À: svg-developers@yahoogroups.com
Envoyé: Vendredi 13 Janvier 2012 10:39:17
Objet: [svg-developers] SVG in HTML5
Hello everyone!
I'm new to SVG and web desi
Thanks Erik. It's surprising from Opera, usually so compliant.
One more reason not to extend prototypes probably.
Yannick.
- Mail original -
De: "Erik Dahlstrom"
À: svg-developers@yahoogroups.com
Envoyé: Jeudi 5 Janvier 2012 15:03:28
Objet: Re: [svg-developers] NodeList.prototype in opera
I can talk about CariSVG since I wrote it. I would be glad if you used it, but
be careful it's a draft, there's already many things I need to improve.
If you need to smooth a path, you can try this little function :
http://jsfiddle.net/ybochatay/gQEZw/
raphaeljs is a great library since it works w
up and down
> elements?
>
> Thanks a lot for that.
>
> Would the elements be listed in the first line as [g4, g8, g12] or as
> ["g4", "g8", "g12"...]?
>
> Do I need to add a onclick event to the text elements from which then the
>
I just downloaded opera 12 alpha and I get the same result. Here's the
screenshot :
Yannick
- Mail original -
De: "Cameron McCormack"
À: svg-developers@yahoogroups.com
Cc: "yannick bochatay"
Envoyé: Mercredi 4 Janvier 2012 23:47:51
O
7;).myExtendedMethod); //undefined
This is not a SVG issue but I didn't found any resource on the web (except this
one without any answer), and I know there are experts in opera browser in this
mailing-list.
Thanks in advance for your help !
Cheers
Yannick Bochatay
[Non-text portions of this
Hi,
the "audio" tag is not SVG but HTML, so you have to use the " foreignobject "
tag :
Yannick
http://ybochatay.fr
- Mail original -
De: "ozeroguz01"
À: svg-developers@yahoogroups.com
Envoyé: Jeudi 22 Décembre 2011 13:58:03
Objet: [svg-developers] audio problem
Hi,
To scale or rotate about a fixed point, you have first to translate your
element so that the fixed point is at the origin.
Then you perform the scaling or rotation and then the inverse of the original
translation to move the fixed point back to its original position.
For example, if you want
and Z segments.
You can set the degree of Bezier Curves to approximate arcs (1 will produce L
segments, 2 Q, 3 C), and the defaultFlatness.
Regards,
Yannick Bochatay
http://ybochatay.fr
- Mail original -
De: "yannick bochatay"
À: svg-developers@yahoogroups.com
Envoyé: Mercredi
be initiated?
Stef
On Oct 13, 2011, at 6:48 AM, yannick.bocha...@free.fr wrote:
> Hi,
> I wrote something quickly (no test), are you looking for something like that ?
> Regards,
>
> Yannick Bochatay
> http://ybochatay.fr
>
> var yourListOfElements = [ elmt1, elmt2 /*, etc
I totally agree with you. Most people are excited with canvas technology but
nobody seems to care about svg, which can usually do as well and for years. I
just do not understand.
I'm not good in marketing but I hope word of mouth will finally make its way.
Regards,
Yannick Bochatay
('mouseout',hideLine,false);
yourElement.addEventListener('click',function() {
yourElement.removeEventListener('mouseout',hideLine,false);
},false);
I hope it will help.
Cheers,
Yannick Bochatay
http://ybochatay.fr
- Mail original -
De: "luftikus_1
Hi,
I wrote something quickly (no test), are you looking for something like that ?
Regards,
Yannick Bochatay
http://ybochatay.fr
var yourListOfElements = [ elmt1, elmt2 /*, etc */ ];
var currentElement = false;
var focusOnElement = function(ind) {
if (currentElement) { /* code to blur
ld do (but not implemented yet) ?
I wrote an example at http://jsfiddle.net/s32LX/, but I've put the code below
anyway.
Best regards,
Yannick Bochatay
http://ybochatay.fr
SVGPathElement.prototype.mtx2attrs = function(mtx) {
var seg,letter,point,pt={},
angle = Math.ata
35 matches
Mail list logo