Way to make image hidden then appear based on circustance?

B

Bob Franz

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
 
C

c.anandkumar

<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
 
J

John

<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)">
 
C

c.anandkumar

I guess both NN and IE support document.images
<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)">
 
B

Bob Franz

Thanx for all the help fellas, sure do appreaciate it.

Bob



I guess both NN and IE support document.images
<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)">
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top