Я очень новичок в jQuery. Я создал небольшой скрипт для анимации цветного фона DIV и границы цвета другого DIV в цикле.
Я использовал плагин цвета jquery, и скрипт работает! (Unbelievable)
Проблема в том, что мой скрипт очень медленный, и у меня проблема с загрузкой страницы (особенно с IE)
Это скрипт:
<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>
Я уверен, что есть лучший способ сделать то же самое.
Здесь вы можете увидеть демо. (Не работает в IE)