开发者

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

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">

&开发者_运维知识库lt;/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>


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜