Image style (and thanks)

  • Thread starter Michael Satterwhite
  • Start date
M

Michael Satterwhite

First I want to thank those who answered my previous question).

I have an image that I'm going to use javascript to fade in. Unfortunately,
in IE I see the image blink as it's being loaded, then go to the fade-in.
What can I do to prevent the image from displaying at all until the form is
loaded - at which point I'll fade it in.

tia
---Michael
 
N

Noozer

Michael Satterwhite said:
First I want to thank those who answered my previous question).

I have an image that I'm going to use javascript to fade in. Unfortunately,
in IE I see the image blink as it's being loaded, then go to the fade-in.
What can I do to prevent the image from displaying at all until the form is
loaded - at which point I'll fade it in.

Set the default "display" style to "none" so the image won't be visible when
the page loads?

Got a link?
 
S

Steve Pugh

Noozer said:
Set the default "display" style to "none" so the image won't be visible when
the page loads?

visibility: hidden; would be better as it reserves the space for the
element, so the pag won't need to reflow when the fade in starts.

Also, don't do this in the main stylesheet. Do it via a style that's
created by JavaScript (I'm assuming that the fade effect is JS
powered) so that users without JS don't miss out on the image
altogether.

So in the <head> of the page include a script that's executed
immediately:
if (check for methods used during the fade effect, can't check for all
objects yet as the page hasn't finished loading) {
document.write('<style type="text/css">.foo
{visibility:hidden;}</style>');
}

and then the image <img class="foo"> will be initially hidden. Later
an onLoad event can change the visibilty and launch the fade in.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top