BlueIshDan
☠
- Local time
- Today, 07:51
- Joined
- May 15, 2014
- Messages
- 1,122
So tea instead of coffee this morning was a mistake!
I am sad to admit that a simple incrementation has me stumped. Haha!
Does anyone understand why my increment is not working correctly.
My attempt was to make the two adds locations traverse through the adds array.
The adds_bottom seems to display only 0 and 2 and the adds_right displays only 1.
I am sad to admit that a simple incrementation has me stumped. Haha!
Does anyone understand why my increment is not working correctly.
My attempt was to make the two adds locations traverse through the adds array.
The adds_bottom seems to display only 0 and 2 and the adds_right displays only 1.
PHP:
var urls = [
"http://admin.csrwire.com/system/profile_logos/12774/original/wmt_logo_2.JPG",
"http://myfrugaladventures.com/wp-content/uploads/2010/07/target_logo.gif",
"https://cantire.taleo.net/careersection/theme/101/1334777976000/en/theme/images/CT_HorzW_Std_RGB.PNG"];
var index = 0;
$("#adds_bottom img:first").attr("src", urls[index++]);
$("#adds_right img:first").attr("src", urls[index++]);
window.setInterval(RotateAdds, 5000);
function RotateAdds()
{
$("#adds_bottom img:first").hide("fast",
function ()
{
$("#adds_bottom img:first").attr("src", urls[index++]);
});
$("#adds_bottom img:first").show("fast");
if (index === urls.length) index = 0;
$("#adds_right img:first").hide("fast",
function ()
{
$("#adds_right img:first").attr("src", urls[index++]);
});
$("#adds_right img:first").show("fast");
if (index === urls.length) index = 0;
}