Actually, the += and -= are perfectly legit for the animate method. They
allow you to animate a property relative to its current value.
http://docs.jquery.com/Effects/animate

I believe the "margin-left" is the throwing it off. Somewhere in the docs it
mentions hyphenated properties should be written in camel case, with no
quotes. So:

$(".items").animate({marginLeft:"+="+amount+"px"},"slow");

And, as per HTML spec, your tabs' id attributes should start with a letter.
That might not cause any issues, but it's better to follow the
specification.
http://www.w3.org/TR/html401/types.html#type-name

Hopefully that's enough to get your script working. If not, try installing
the Firebug plug-in for Firefox and litter your code with console.log("some
text or element") statements to see what is/isn't being fired/passed around.
Make sure to comment them out or remove them before publishing. :)

Beyond that (not related to your problem -- just unsolicited advice), you
may consider using the id on the item elements and having your tabs be
anchor links with an href="#id" ... to make it work with JavaScript
disabled.

Brian.




On 2/14/08, andrea varnier <[EMAIL PROTECTED]> wrote:
>
>
> >  $(".items").animate({"margin-left":"+="+amount+"px"},"slow");
> > I really hope you can help me, I had never encountered this problem
> before.
>
>
> try and take away those '+=', you wouldn't write a css rule like this
>
> margin-left: +=300px;
>
> :)
>

Reply via email to