/    Sign up×
Community /Pin to ProfileBookmark

jquery color plugin

Hi,
I’m very new to jQuery, so sorry for the stupid question!
I created a little script to animate color background of a DIV and border color of another DIV in loop.
I used the jquery color plugin and the script works!! (Unbelievable)

The problem is that my script is veeery slow, and a i have problem with page loading (especially with IE)
This is the script

[CODE] <script type=”text/javascript”>
$(document).ready(function() {

spectrum();

function spectrum(){
$(‘#rt-main’).animate( { backgroundColor: “#aeff00” }, 5000);
$(‘#rt-main’).animate( { backgroundColor: “#ff6c00” }, 5000);
$(‘#rt-main’).animate( { backgroundColor: “#0086b6” }, 5000);
$(‘#rt-main’).animate( { backgroundColor: “#00a4a8” }, 5000);
$(‘#rt-main’).animate( { backgroundColor: “#d43795” }, 5000);
$(‘#rt-main’).animate( { backgroundColor: “#ffd200” }, 5000);
$(‘#rt-header’).animate( { borderTopColor: “#aeff00” }, 5000);
$(‘#rt-header’).animate( { borderTopColor: “#ff6c00” }, 5000);
$(‘#rt-header’).animate( { borderTopColor: “#0086b6” }, 5000);
$(‘#rt-header’).animate( { borderTopColor: “#00a4a8” }, 5000);
$(‘#rt-header’).animate( { borderTopColor: “#d43795” }, 5000);
$(‘#rt-header’).animate( { borderTopColor: “#ffd200” }, 5000);
spectrum();
}

});
</script>[/CODE]

I’m sure there a better way to do the same thing.
Here you can see a demo.(not in IE)

Thanks

Gil

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @g1lb0 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...