// ------------------------------ // SIMPLE IMAGE ROTATION BY DOM // ver 1.0 // BY ANDREW CANTWELL // THE DCP GROUP // ------------------------------ var ord=0; var imgPath="/wp-content/themes/ldhs/images/"; function rotateImage(el) { if (!document.getElementById) {return;} // Return if no DOM // Find element and set "src" attribute var myEl=document.getElementById(el); myEl.src=imgPath+img[ord]; //alert(myEl.src); // Go through array ord+=1; // Reset to rotate from start // when array limit reached if (ord==img.length) { ord=0; } // close "if" condition } // close function