What version of jQuery are you using? I just tested the animate
function in 1.2.6 and it only installs 1 timer.

In the 1.2.6 uncompressed source the interval timer creation is on
line 3231. You can put a console.log message, break point or alert on
that line and see for yourself.

You do see a difference in start times for each object, but it still
only uses 1 timer.

Karl Rudd

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
  <script src="jquery-1.2.6.js"></script>
  <script>
  $(document).ready(function(){

    // Using multiple unit types within one animation.
    $("#go").click(function(){
      $(".block").animate({
        width: "70%",
        opacity: 0.4,
        marginLeft: "0.6in",
        fontSize: "3em",
        borderWidth: "10px"
      }, 1500 );
    });

  });
  </script>
  <style>
  div {
    background-color:#bca;
    width:100px;
    border:1px solid green;
  }
  </style>
</head>
<body>
  <button id="go">ยป Run</button>
  <div class="block">Hello!</div>
  <div class="block">Hello!</div>
  <div class="block">Hello!</div>
</body>
</html>

On Tue, Sep 9, 2008 at 8:32 AM, chanel <[EMAIL PROTECTED]> wrote:
>
> I have a problem with the way the "animate" method handles multiple
> attributes.  Currently, timers are created for each attribute you are
> trying to animate.  This means that if you are changing 2 attributes
> on 3 DOM elements, jquery will create 15 timers.
>
> In my opinion, this is not the most optimal or desired way of
> completing the animation.  When a large number of animation timers is
> executed, the normal linear animation turns into a very abrupt/choppy
> easing effect.  In some cases, this is inevitable but most of the
> time, I believe this effect can be eliminated if animations were
> grouped together in one timer.
>
> If anybody is working on a plugin that would remedy this problem, or
> even seen/heard of something very similar, I would be very interested
> in checking it out.  I am currently working on my own solution, but it
> just might be that I'm trying to use javascript for something it was
> not meant to handle.
>

Reply via email to