I'm trying to get the animation you see here http://capricaribbean.org/newspage on the banner to go on indefinately. Im no jquery expert so here is the code I came up with from googling and hacking around. Unfortunately it goes for only 1 cycle then says "Error: doMessages is not defined"
can I get some help on doing this right please
<script> $(document).ready(function () { function doMessages() { $("#msg1").fadeIn(3000, function () {$("#msg1").fadeOut(3000, function () { $("#msg2").fadeIn(3000, function () {$("#msg2").fadeOut(3000, function () {$("#msg3").fadeIn(3000, function () {$("#msg3").fadeOut(3000, function () {$("#msg4").fadeIn(3000, function () {$("#msg4").fadeOut(3000);});})})})})})}); setTimeout( ' doMessages();', 500 );}doMessages(); }); </script>
<style>
.msg{ color:#E9E3D6; font-size:20px; font-weight:bold; left:690px; position:absolute; text-align:center; top:30px; width:300px; display:none }
</style>
<img src="/sites/default/themes/theme078/images/banner_news.jpg" border="0" class="logo" /></a> <div id="msg1" class="msg">Telling The Story From Another Angle</div> <div id="msg2" class="msg">Get Turned On To The Economy</div> <div id="msg3" class="msg">Fresh Voices, Fresh Perspectives</div> <div id="msg4" class="msg">When You Need To Know What The Heck Is Going On</div>
FIXED!! the setTimeout() was doing some out of scope issues, so i ditched it
$(document).ready(function () { function foo(){ $("#msg1").fadeIn(3000, function () {$("#msg1").fadeOut(3000, function () { $("#msg2"). fadeIn(3000, function () {$("#msg2").fadeOut(3000, function () {$("#msg3").fadeIn(3000, function () { $("#msg3").fadeOut(3000, function () {$("#msg4").fadeIn(3000, function () {$("#msg4").fadeOut(3000, function () {foo();});});})})})})})});} foo()});
R.A.Smith Manager/Technical Lead Exterbox - "Thinking outside of the box" http://www.exterbox.com rohan@exterbox.com 1-876-449-7506
On Wed, Jun 23, 2010 at 4:35 AM, Rohan Smith rohanasmith@gmail.com wrote:
I'm trying to get the animation you see here http://capricaribbean.org/newspage on the banner to go on indefinately. Im no jquery expert so here is the code I came up with from googling and hacking around. Unfortunately it goes for only 1 cycle then says "Error: doMessages is not defined"
can I get some help on doing this right please
<script> $(document).ready(function () { function doMessages() { $("#msg1").fadeIn(3000, function () {$("#msg1").fadeOut(3000, function () { $("#msg2").fadeIn(3000, function () {$("#msg2").fadeOut(3000, function () {$("#msg3").fadeIn(3000, function () {$("#msg3").fadeOut(3000, function () {$("#msg4").fadeIn(3000, function () {$("#msg4").fadeOut(3000);});})})})})})}); setTimeout( ' doMessages();', 500 );}doMessages(); }); </script>
<style> .msg{ color:#E9E3D6; font-size:20px; font-weight:bold; left:690px; position:absolute; text-align:center; top:30px; width:300px; display:none } </style>
<img src="/sites/default/themes/theme078/images/banner_news.jpg" border="0" class="logo" /></a>
<div id="msg1" class="msg">Telling The Story From Another Angle</div> <div id="msg2" class="msg">Get Turned On To The Economy</div> <div id="msg3" class="msg">Fresh Voices, Fresh Perspectives</div> <div id="msg4" class="msg">When You Need To Know What The Heck Is Going On</div>