473,320 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Way to make image hidden then appear based on circustance?

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
4 10959
<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
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Kai Grossjohann | last post by:
I have a frame which is supposed to contain a list of links. The clickable area of each link comprises a picture followed by some text. I want the text to be cut at the right hand side when the...
0
by: Salagir | last post by:
I crosspost and followup to comp.infosystems.www.authoring.stylesheets because we're not really on the webcomic topic any more :) On Thu, 19 Aug 2004 11:40:07 GMT, in rec.arts.comics.strips,...
1
by: Dooboise | last post by:
Hi. For my website, I'm trying to develop a JavaScript that makes a div appear. I have found several samples that toggle a div back and forth between visible and hidden, but what I need is a bit...
3
by: Mutant Merv | last post by:
Sorry all it's me again. Can you see from the following why my picture will not appear on the web page. <html> <head> <title>Bubble & Suds</title> </head> <img src="bs3.jpg" /> <body...
4
Elias Alhanatis
by: Elias Alhanatis | last post by:
Hello everybody!! I would like some help with the following problem: I have the following piece of code: from Tkinter import * root = Tk()
3
by: Pero | last post by:
How to make image of web page, like this: http://www.networksolutions.com/whois/results.jsp?domain=test.com Tnx Pero
1
by: jobsjournal | last post by:
hi, i'm a newbie here. need help on how to make &lt; appear as &lt; and a&gt; appear as a&gt; without turning to the < and > sign, respectively. just for knowledge thanks jobs
4
by: KiwiGenie | last post by:
I have an image on my report that I want to make visible only when a yes/no field is true. The yes/no field is a hidden text box called txtTried. The code I've been trying to use is: If Me!txtTried...
1
by: aisha siddiqui | last post by:
want to make a hidden div that will hold a flash movie.onclick event i want to get this div visible on same page / document. Is it possible? how it will become hidden after flash clip is completed.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.