funeralcrasher: (Default)
funeralcrasher ([personal profile] funeralcrasher) wrote2005-12-01 08:22 pm
Entry tags:

unusual request - blinking img

Could I make an image 'blink' off an on, using Javascript?  (in case you wondered an animated gif is not an option in this project)    How would I do this?

[identity profile] auntyjen.livejournal.com 2005-12-02 02:18 am (UTC)(link)
does the html blink tag work for images?

[identity profile] eringurrl.livejournal.com 2005-12-02 02:31 am (UTC)(link)
if you give the img tag an id it makes it easier to reference in javascript then you can just change the image's source attribute to like an image that is all white, put that into a loop...

function getObj(objId)
{	
    if (document.layers) 
        return document.layers[objId]; 
    if (document.getElementById) 
        return document.getElementById(objId); 
    if (document.all) 
        return document.all[objId]; 
    if (document[objId]) 
        return document[objId]; 
    return false;
}

var orgSource = "";
While True {
    orgSource = getObj("imageidname").src
    getObj("imageidname").src = "http://...";
    //some sorta wait timer
    getObj("imageidname").src = orgSource;
}


I'd imagine something to that effect.