I have tried several js scripts to make images blink. None have worked in my IE6 browser. Does anyone have a good script for this function that allows flexibility in the blink rate? I don't want to overly annoy viewers with rapid distractions. Yes, I agree that blinking should be banned but my client insists!
function changeImg(){
document.getElementById("imgId").src = (document.getElementById("imgId").src.indexOf("OnPic.gif") == -1)?"OnPic.gif":"OffPic.gif";
}
window.onload = function(){
var xTimer = window.setInterval("changeImg()",2000);
}
If you need to do it with multiple images, you can make it OO or just add more statements in the function referencing the images.
Eric
Eric - I cut/pasted the above code from your reply into the header area of my page and changed the image names to those on my server. When I display the page in an IE browser the code text is displayed on the page across the top. No blinking anything. Am I missing some of the code?
BTW, how does the browser know where to place the image? I thought I would have to put a call to the function in the page code where I wanted the image placed although you did say the function is automatically called when the page is opened.
Bookmarks