473,372 Members | 894 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,372 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 10962
<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.
1
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: 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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.