Loading ...
Sorry, an error occurred while loading the content.

Re: [svg-developers] SVG and jQuery

Expand Messages
  • narendra sisodiya
    I have already used jquery svg plugin , http://plugins.jquery.com/project/svg actually, I have consulted with author of that plugin also, he repiled .. *On
    Message 1 of 6 , Feb 2, 2009
    • 0 Attachment
      I have already used jquery svg plugin ,
      http://plugins.jquery.com/project/svg
      actually, I have consulted with author of that plugin also, he repiled ..

      *On Mon, Feb 2, 2009 at 3:17 PM, Keith Wood
      <kbwood@...>wrote:
      Hi Narendra

      You can use some jQuery constructs within an SVG document, but not all.
      jQuery is designed to work with the HTML DOM, which is different from the
      SVG DOM. You can get the element initially from its construction or via the
      getElementById function:

      var svg = $('container').svg('get');
      var circle = svg.circle(50, 50, 20);
      $(circle).attr('r', 10);
      var elem = svg.getElementById('rect1');
      $(elem)...*

      Actually I want to full selector support for SVG DOM.
      for example,
      $("circle").attr("r" , 50 ) ;
      should set all circle of svg to radius equal to 50.
      so that in svg ecmascript, I want to use $(g .myclass #mainbox).hide() and
      so on


      so is it possible to port the jquery for SVG DOM. because svg do support
      ECMAScript, so full support of jquery for svg is technically possible
      project.
      what do you think about full support. Actually I want full support of jquery
      for svg but I am unable to get technical difficulties behind it.


      [Non-text portions of this message have been removed]
    • Felipe Sanches
      I once tryied unsucsessfully to use animation features from jquery to animate SVG. Yes I know that SVG has its own animation support, But I would like to be
      Message 2 of 6 , Feb 2, 2009
      • 0 Attachment
        I once tryied unsucsessfully to use animation features from jquery to
        animate SVG. Yes I know that SVG has its own animation support, But I would
        like to be able to also use jquery syntax with selectors, etc...

        On Mon, Feb 2, 2009 at 4:19 PM, narendra sisodiya <
        narendra.sisodiya@...> wrote:

        > I have already used jquery svg plugin ,
        >
        > http://plugins.jquery.com/project/svg
        > actually, I have consulted with author of that plugin also, he repiled ..
        >
        > *On Mon, Feb 2, 2009 at 3:17 PM, Keith Wood
        > <kbwood@... <kbwood%40virginbroadband.com.au>>wrote:
        > Hi Narendra
        >
        > You can use some jQuery constructs within an SVG document, but not all.
        > jQuery is designed to work with the HTML DOM, which is different from the
        > SVG DOM. You can get the element initially from its construction or via the
        > getElementById function:
        >
        > var svg = $('container').svg('get');
        > var circle = svg.circle(50, 50, 20);
        > $(circle).attr('r', 10);
        > var elem = svg.getElementById('rect1');
        > $(elem)...*
        >
        > Actually I want to full selector support for SVG DOM.
        > for example,
        > $("circle").attr("r" , 50 ) ;
        > should set all circle of svg to radius equal to 50.
        > so that in svg ecmascript, I want to use $(g .myclass #mainbox).hide() and
        > so on
        >
        > so is it possible to port the jquery for SVG DOM. because svg do support
        > ECMAScript, so full support of jquery for svg is technically possible
        > project.
        > what do you think about full support. Actually I want full support of
        > jquery
        > for svg but I am unable to get technical difficulties behind it.
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >


        [Non-text portions of this message have been removed]
      • Erik Dahlström
        ... jQuery is indeed quite html-centric, so to use it either you need to have an html document as the main document, or you need to modify the jQuery source. A
        Message 3 of 6 , Feb 3, 2009
        • 0 Attachment
          On Tue, 03 Feb 2009 04:00:00 +0100, Felipe Sanches <felipe.sanches@...> wrote:

          > I once tryied unsucsessfully to use animation features from jquery to
          > animate SVG. Yes I know that SVG has its own animation support, But I would
          > like to be able to also use jquery syntax with selectors, etc...

          jQuery is indeed quite html-centric, so to use it either you need to have an html document as the main document, or you need to modify the jQuery source.

          A quick hack of the jquery source to allow it to work on standalone SVG documents, (and which have no guarantees of being fully tested or even remotely correct can be found here):

          http://xn--dahlstrm-t4a.net/svg/jquery

          This simple animation worked fine in Opera, Firefox and Safari.

          Cheers
          /Erik

          --
          Erik Dahlstrom, Core Technology Developer, Opera Software
          Co-Chair, W3C SVG Working Group
          Personal blog: http://my.opera.com/macdev_ed
        Your message has been successfully submitted and would be delivered to recipients shortly.