var img=1;
var imgUrl;
var imgCount =5;
$(document).ready(function(){
document.getElementById("imgm").src="Images/test1.jpg"; // setup first image on pageload
setup();
});
function setup() {
if(img>imgCount){ // if img is greater than the value of imgCount set to 1
img=1;
}else{
img++;//add 1 to the current numeric value
}
imgUrl="Images/test"+img+".jpg";//set imgUrl based on current img numeric value
setTimeout(anim(), 5000);
}
function anim(){
$("#imgm").fadeOut("slow",function(){//fade out element with an id of "imgm"
$(this).attr('src',imgUrl).fadeIn("slow");//once fadeout has completed, change src attribute of "imgm" to value of imgUrl, then fade in
});
alert("test");
setup();
}
ok it seems to just not display the image now, however the alert() is showing so assumably it should be working. also the get() function was from an earlier program where the sources all had different names instead of test. anyway thanks for the help, ill see if i can get this to work,might just be the crappy computer im working on though im not sure if that would have an effect.
dont give up so easily. if its not working there msut be a reason. can you show use more of the html for the page? how about the html for the img element?