By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,629 Members | 1,703 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,629 IT Pros & Developers. It's quick & easy.

Way to make image hidden then appear based on circustance?

P: n/a
Hello everyone,

Basically what I am wondering is I have a running timer and once it
reaches a certain time I want an image to apear that the user can
click on. Is this possible and if it is can someone point a complete
newbie in the right direction.

Bob
Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
<script language="Javascript">
var timeToSleep = 10000; // in millisecs
function showImage ()
{
document.images['imageName'].style.visibility = hidden;
}
</script>
<body onLoad="javascript:setTimeout('showImage()', timeToSleep)">
.....

Thanks

Anand

Jul 23 '05 #2

P: n/a
"c.**********@gmail.com" <c.**********@gmail.com> wrote in
news:11**********************@l41g2000cwc.googlegr oups.com:
<script language="Javascript">
var timeToSleep = 10000; // in millisecs
function showImage ()
{
document.images['imageName'].style.visibility = hidden;
}
</script>
<body onLoad="javascript:setTimeout('showImage()', timeToSleep)">
....

Thanks

Anand


a) that would HIDE the image after 10 seconds ... well it would if you
had quotes around the word hidden.
b) I think that would only work in IE (document.images I believe is IE
specific, correct me if I'm wrong)

try this

given the link is as follows:
<a href="whatever.the.link.is" id="xxx" style="visibility:hidden;"><img
src="theImage.jpg"></a>

within the document header, put

<script language="Javascript">
var timeToSleep = 10000; // in millisecs
function showImage()
{
var x=null;
if(document.getElementById)
x=document.getElementById("xxx");
else if (document.images)
x=document.images['imageName'];
if(x && x.style)
x.style.visibility = "visible";
</script>

and, in the body tag:
<body onLoad="javascript:setTimeout('showImage();', timeToSleep)">
Jul 23 '05 #3

P: n/a
I guess both NN and IE support document.images

John wrote:
"c.**********@gmail.com" <c.**********@gmail.com> wrote in
news:11**********************@l41g2000cwc.googlegr oups.com:
<script language="Javascript">
var timeToSleep = 10000; // in millisecs
function showImage ()
{
document.images['imageName'].style.visibility = hidden;
}
</script>
<body onLoad="javascript:setTimeout('showImage()', timeToSleep)">
....

Thanks

Anand
a) that would HIDE the image after 10 seconds ... well it would if

you had quotes around the word hidden.
b) I think that would only work in IE (document.images I believe is IE specific, correct me if I'm wrong)

try this

given the link is as follows:
<a href="whatever.the.link.is" id="xxx" style="visibility:hidden;"><img src="theImage.jpg"></a>

within the document header, put

<script language="Javascript">
var timeToSleep = 10000; // in millisecs
function showImage()
{
var x=null;
if(document.getElementById)
x=document.getElementById("xxx");
else if (document.images)
x=document.images['imageName'];
if(x && x.style)
x.style.visibility = "visible";
</script>

and, in the body tag:
<body onLoad="javascript:setTimeout('showImage();', timeToSleep)">


Jul 23 '05 #4

P: n/a
Thanx for all the help fellas, sure do appreaciate it.

Bob

On 9 Mar 2005 02:01:05 -0800, "c.**********@gmail.com"
<c.**********@gmail.com> wrote:
I guess both NN and IE support document.images

John wrote:
"c.**********@gmail.com" <c.**********@gmail.com> wrote in
news:11**********************@l41g2000cwc.googlegr oups.com:
> <script language="Javascript">
> var timeToSleep = 10000; // in millisecs
> function showImage ()
> {
> document.images['imageName'].style.visibility = hidden;
> }
> </script>
> <body onLoad="javascript:setTimeout('showImage()', timeToSleep)">
> ....
>
> Thanks
>
> Anand
>
>


a) that would HIDE the image after 10 seconds ... well it would if

you
had quotes around the word hidden.
b) I think that would only work in IE (document.images I believe is

IE
specific, correct me if I'm wrong)

try this

given the link is as follows:
<a href="whatever.the.link.is" id="xxx"

style="visibility:hidden;"><img
src="theImage.jpg"></a>

within the document header, put

<script language="Javascript">
var timeToSleep = 10000; // in millisecs
function showImage()
{
var x=null;
if(document.getElementById)
x=document.getElementById("xxx");
else if (document.images)
x=document.images['imageName'];
if(x && x.style)
x.style.visibility = "visible";
</script>

and, in the body tag:
<body onLoad="javascript:setTimeout('showImage();', timeToSleep)">


Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.