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

Re: Animation and begin=mouseover in

Expand Messages
  • fruc13
    you should ad an ID to the use element that instances the original defined in defs. Than you start the animation using begin= element_id.mouseover . You can
    Message 1 of 10 , Mar 1, 2002
    • 0 Attachment
      you should ad an ID to the use element that instances the original
      defined in defs. Than you start the animation using
      begin="element_id.mouseover". You can not use the ID defined for the
      original (it may be resolved in SVG 2.0).

      Example:
      http://www.rattus.info/tests/preload/glavonozec_anim_old.svg

      izto jeras
      www.rattus.info

      --- In svg-developers@y..., "simonjbradleyuk" <simon.bradley@a...>
      wrote:
      > Hi,
      >
      > I am trying to start a declarative animation on an object that is
      > defined in a def element, then drawn. It works if the animation
      does
      > not have a begin attribute however I would like to start the
      > animation when it receives the mouseover event, so
      begin="mouseover"
      > should work.
      >
      > Any ideas?
      >
      > Simon.
      >
      > code fragment if you are interested:
      > <svg>
      > <defs>
      > <polygon id="star1" style="fill:black;fill-rule:nonzero;"
      > points="0,-14 8.229,11.326 -13.315,-4.326 13.315,-4.326 -
      > 8.229,11.326">
      > <animateTransform attributeName="transform" type="rotate"
      > values="0;360" dur="3s" repeatDur="indefinite"/>
      > </polygon>
      > <polygon id="star2" style="fill:red;fill-rule:nonzero;"
      > points="0,-14 8.229,11.326 -13.315,-4.326 13.315,-4.326 -
      > 8.229,11.326">
      > <animateTransform attributeName="transform" type="rotate"
      > values="0;360" dur="3s" repeatDur="indefinite" begin="mouseover"/>
      > </polygon>
      > </defs>
      > <polygon style="fill:lime;fill-rule:nonzero;" points="0,-14
      > 8.229,11.326 -13.315,-4.326 13.315,-4.326 -8.229,11.326">
      > <animateTransform attributeName="transform" type="rotate"
      > values="0;360" dur="3s" repeatDur="indefinite" begin="mouseover"/>
      >
      > </polygon>
      > <use xlink:href="#star1" x="30" y="30"/>
      > <use xlink:href="#star2" x="60" y="60"/>
      >
      > </svg>
    • simonjbradleyuk
      Works fine, if I want to use the object just once. However I want to use the element many times, each one having a seperate id. But that means that the
      Message 2 of 10 , Mar 1, 2002
      • 0 Attachment
        Works fine, if I want to use the object just once. However I want to
        use the <use> element many times, each one having a seperate id. But
        that means that the begin attribute for the source object must
        include all the <use> element ids?

        Simon.
      • fruc13
        Very good article and a beautiful animated example. About SVG 1.1 supporting separate animation for instances, is it true. Is there something like these in SVG
        Message 3 of 10 , Mar 1, 2002
        • 0 Attachment
          Very good article and a beautiful animated example.

          About SVG 1.1 supporting separate animation for instances, is it true.
          Is there something like these in SVG 1.1?

          IzI

          --- In svg-developers@y..., "Antoine Quint" <antoine@g...> wrote:
          > Hi,
          >
          > > I am trying to start a declarative animation on an object that is
          > > defined in a def element, then drawn. It works if the animation
          does
          > > not have a begin attribute however I would like to start the
          > > animation when it receives the mouseover event, so
          begin="mouseover"
          > > should work.
          > >
          > > Any ideas?
          >
          > Try to take a look at an article I wrote that does this kind of
          thing:
          >
          > http://www.xml.com/pub/a/2002/01/23/svg/index.html
          >
          > Antoine
        • Antoine Quint
          ... I don t think it is clear at the moment. Feel free to send a formal comment that will be taken into account by the Working Group at www-svg-comments@w3.org
          Message 4 of 10 , Mar 1, 2002
          • 0 Attachment
            > About SVG 1.1 supporting separate animation for instances, is it true.
            > Is there something like these in SVG 1.1?

            I don't think it is clear at the moment. Feel free to send a formal
            comment that will be taken into account by the Working Group at
            www-svg-comments@...

            Antoine
          • fruc13
            Yes it means that you have to create separate animation for all the instances. But you cant do it at the source object, you should put it where the instance
            Message 5 of 10 , Mar 1, 2002
            • 0 Attachment
              Yes it means that you have to create separate animation for all the
              instances.
              But you cant do it at the source object, you should put it where the
              instance is. Antoine's example shows a way how to do it. Another way
              is to multiply the original in javascript, renaming it's id's.

              An example of copying of elements with id renaming is on:
              http://www.rattus.info/stran/predsoba.svgz

              function event_log(text) {
              var event = document.getElementById('event_log');
              var new_event=event.cloneNode(1);
              new_event.removeAttribute('id');
              new_event.getFirstChild().setData(text);
              event.parentNode.appendChild(new_event);
              }

              iztok jeras
              www.rattus.info

              --- In svg-developers@y..., "simonjbradleyuk" <simon.bradley@a...>
              wrote:
              > Works fine, if I want to use the object just once. However I want
              to
              > use the <use> element many times, each one having a seperate id.
              But
              > that means that the begin attribute for the source object must
              > include all the <use> element ids?
              >
              > Simon.
            • fruc13
              Hi Antoine I have checked the w3c intentions for animated instances. The interesting is: 1.) SVG should investigate alternative approaches to associating
              Message 6 of 10 , Mar 1, 2002
              • 0 Attachment
                Hi Antoine

                I have checked the w3c intentions for animated instances. The
                interesting is:
                1.) SVG should investigate alternative approaches to associating
                animation elements with the elements being animated. [SVG 2.0]
                2.) SVG 1.1 should provide a mechanism to support streaming
                animations. A potential solution is to provide a method to start the
                document timeline when the document is loaded. [SVG 1.1]

                So:
                1.) we should wait for SVG 2.0 for animated instances or we should
                offer a method that could be added to SVG 1.1 (id is not extensible
                enought)
                2.) svg 1.1 should provide a method to stream animation but I could
                not find the word stream in the 1.1 animation spec.

                I proposed them add an xlink:actuate attribute at least to the image
                element, this would enable an image to begin loading after an event
                and not always at the beginning of the main svg. This would enable
                sequential downloading of animated images, so that the first part of
                the animation would load faster.

                iztok jeras
                www.rattus.info

                P.S.: About formal comments, I send comments to www-svg@... so
                that I can see their reactions if they answer (they mostly don't). Is
                it better to send them to www-svg-comments@...?

                --- In svg-developers@y..., "Antoine Quint" <antoine@g...> wrote:
                > > About SVG 1.1 supporting separate animation for instances, is it
                true.
                > > Is there something like these in SVG 1.1?
                >
                > I don't think it is clear at the moment. Feel free to send a formal
                > comment that will be taken into account by the Working Group at
                > www-svg-comments@w...
                >
                > Antoine
              • Chris Lilley
                On Friday, March 01, 2002, 1:24:49 PM, fruc13 wrote: f I proposed them add an xlink:actuate attribute at least to the image f element, this would enable an
                Message 7 of 10 , Mar 1, 2002
                • 0 Attachment
                  On Friday, March 01, 2002, 1:24:49 PM, fruc13 wrote:

                  f> I proposed them add an xlink:actuate attribute at least to the image
                  f> element, this would enable an image to begin loading after an event
                  f> and not always at the beginning of the main svg. This would enable
                  f> sequential downloading of animated images, so that the first part of
                  f> the animation would load faster.

                  Yes, we read that.

                  f> iztok jeras
                  f> www.rattus.info

                  f> P.S.: About formal comments, I send comments to www-svg@...

                  That is a discussion list, not a comment drop-box. (btw its @...)

                  f> so
                  f> that I can see their reactions if they answer (they mostly don't).

                  Comments are addressed - in the next draft, and after the WG as a whole
                  has discussed them. Or we say (as we did in the recent last call
                  draft) that particular comments are not addressed.


                  f> Is
                  f> it better to send them to www-svg-comments@...?

                  Yes.

                  If you also want to discuss them, then copy the comments here.

                  f> --- In svg-developers@y..., "Antoine Quint" <antoine@g...> wrote:
                  >> > About SVG 1.1 supporting separate animation for instances, is it
                  f> true.
                  >> > Is there something like these in SVG 1.1?
                  >>
                  >> I don't think it is clear at the moment. Feel free to send a formal
                  >> comment that will be taken into account by the Working Group at
                  >> www-svg-comments@w...
                  >>
                  >> Antoine


                  --
                  Chris mailto:chris@...
                • Tobias Reif
                  ... Well, if you want to animate all the instances in the same way, and @ the same time, you can simply animate the def d object.
                  Message 8 of 10 , Mar 2, 2002
                  • 0 Attachment
                    simonjbradleyuk wrote:

                    > Works fine, if I want to use the object just once. However I want to
                    > use the <use> element many times, each one having a seperate id. But
                    > that means that the begin attribute for the source object must
                    > include all the <use> element ids?


                    Well, if you want to animate all the instances in the same way, and @
                    the same time, you can simply animate the def'd object.


                    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
                    <defs>
                    <rect id="r1" width="10" height="10"/>
                    </defs>
                    <animateTransform xlink:href="#r1" attributeName="transform"

                    type="rotate" values="0;360" dur="3s" repeatDur="indefinite" begin="mouseover"/>
                    <use xlink:href="#r1" x="30" y="30"/>
                    <use xlink:href="#r1" x="60" y="60"/>
                    </svg>


                    Tobi


                    --

                    * peace&love.
                    * http://www.pinkjuice.com/
                  Your message has been successfully submitted and would be delivered to recipients shortly.