views:

25

answers:

2

the Color Animations doesn't wokr on webkit(safari chrome)

http://plugins.jquery.com/project/color

<script type="text/javascript" src="jquery.color.js">s</script>
$('#start').animate({ 'backgroundColor':'yellow' }, 1000,'linear', function() {
        })

it is works well on firefox

why ?

thanks


the answer is background,look next code

and you will be find a is not run,and b is ok(in safari and chrome):

<dl id=a style="width:100px;height:100px;">

</dl>
<dl id=b style="width:100px;height:100px;background:#fff">

</dl>
<script src="jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="jquery.color.js" type="text/javascript"></script>
<script type="text/javascript">
$('#a,#b').animate({ backgroundColor: "orange" }, 1000)
.animate({ backgroundColor: "yellow" }, 1000)
.animate({ backgroundColor: "green" }, 1000)
</script>
A: 

the demo page works, so there must be something wrong with your code or you are using an older jQuery-version.

oezi
Its set to work with jquery 1.2, and I don't see multiple versions of the plugin. Very odd. I'm going to try it.
Anthony
A: 

Two things I'm noticing from your example:

First, you have a stray letter s in your script tag. Not sure if that's in your code or how various browsers handle it.

Second, you don't actually have the body of the script wrapped in any kind of document.ready type wrapper, and you don't have the function tied to an event handler, which means that, at least with what you are showing us, the script is maybe loaded before the document is ready, it isn't seeing the #start element, so it just never does anything.

Anthony