funeralcrasher: (Default)
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?

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

Date: 2005-12-02 08:20 am (UTC)From: [identity profile] pkbarbiedoll.livejournal.com
that is browser-specific and only controls text.

Date: 2005-12-02 02:31 am (UTC)From: [identity profile] eringurrl.livejournal.com
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.

Date: 2005-12-02 08:22 am (UTC)From: [identity profile] pkbarbiedoll.livejournal.com
okay, or I could use an invisible spacer pixel, resized to the image I'm replacing.. I'll try this tomorrow & will let you know how it goes. :)

Date: 2005-12-02 04:38 pm (UTC)From: [identity profile] eringurrl.livejournal.com
You could use really whatever would suit your needs best :P
I think .width = x and .height = y works to resize the image in code.

Profile

funeralcrasher: (Default)
funeralcrasher

June 2020

S M T W T F S
 123456
78910111213
141516 1718 1920
21222324252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 17th, 2025 12:28 am
Powered by Dreamwidth Studios