473,566 Members | 3,209 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hidden/visible divs

okay ive been working at this for probably 4 hours now, and I (not to
mention my boss) am pretty upset.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitl ed Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script src="AC_RunActi veContent.js" language="JavaS cript"
type="text/javascript"></script>
<script src="AC_Flash.j s" language="JavaS cript"
type="text/javascript"></script>
<script>
function show0(){
document.getEle mentByID('shift ').style.visibi lity = 'visible';
}
function hide0(){
document.getEle mentByID('shift ').style.visibi lity = 'hidden';
}
function show1(){
document.getEle mentByID('flash ').style.visibi lity = 'visible';
}
function hide1(){
document.getEle mentByID('flash ').style.visibi lity = 'hidden';
}
function doTimer() {
var timeout
timeout = setTimeout("sho w1();hide0();", 30000);
}

function changePic(newCo ntent) {
document.images['main'].src = newContent;
show0()
hide1()
window.cleartim out(timeout)
doTimer()
}
</script>
</head>

<body>
<div style="position :absolute;top:0 px;left:0px;vis ibility:hidden; "
id="shift"> <img src="pics/dvd.jpg" width="300" height="220"
name="main"> </div>
<div style="position :absolute;top:0 px;left:0px;vis ibility:visible ;"
id="flash">
<noscript>
<object classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=6,0,29,0"
width="300" height="220">
<param name="movie" value="shift.sw f">
<param name="quality" value="high">
<embed src="shift.swf" quality="high"
pluginspage="ht tp://www.macromedia. com/go/getflashplayer"
type="applicati on/x-shockwave-flash" width="300"
height="220"></embed></object>
</noscript>
<script language="JavaS cript" type="text/javascript" >
<!--
AC_RunFlContent X ("movie", "shift" , "quality", "high" ,
"bgcolor", "#FFFFFF" , "src", "shift" , "width", "300" , "height",
"220" , "name" , "shift", "id", "shift");
//-->
</script>
</div>
</body>
</html>

The function is called from a parent frame. When a user clicks on a
thumbnail, the shift.swf (rollover animation) movie is supposed to
become invisible and the new image should take its place. After 30
seconds, it should revert back to the way it was until another change
function is called.

Its really depressing cause i know the fix is going to be something
very simple.

Apr 19 '06 #1
4 2339
re*******@gmail .com wrote:
okay ive been working at this for probably 4 hours now,
and I (not to mention my boss) am pretty upset. <snip>
The function
Which function? (I see six, and two imported JS files (presumably full
of functions themselves)).
is called from a parent frame.
So there is more HTML and script that is not shown. That means that
this cannot be tested to determine how it behaves in any environment.
Though it probably could not be tested anyway as the swf files, images
and eternal javascript files would be needed to do that. This is
probably a case where providing the URL on an online example of this
problem would be most appropriate.
When a user clicks on a thumbnail, the shift.swf (rollover
animation) movie is supposed to become invisible and the new
image should take its place. After 30 seconds, it should
revert back to the way it was until another change
function is called.
That is what it is supposed to do, but what does it actually do? Are any
errors generated?
Its really depressing cause i know the fix is going to be
something very simple.


No reproducible demonstration of the issue, no description of symptoms.
The best responses you are likely to get will be random wild guesses;
mine is javascript pseudo-protocol HREFs. Simple to fix but an example
of pure coincidence if they are even relevant ;-)

Richard.
Apr 19 '06 #2
getElementByID should be getElementById note the lowercase D in Id. I
also change visibility to display note the differences. Here is some
very simple code that works after 3 seconds but only once...

<html>
<head>
<title></title>
<script type="text/javascript">

function HideIt(){
document.getEle mentById('shift ').style.displa y = 'inline';
document.getEle mentById('flash ').style.displa y = 'none';
}

function ShowIt() {
document.getEle mentById('shift ').style.displa y = 'inline';
document.getEle mentById('flash ').style.displa y = 'none';
}

function doTimer() {
var timeout
timeout = setTimeout("Sho wIt();", 3000);
}

</script>
</head>
<body onload=doTimer( )>
<div style="display: none;" id="shift">SHIF T</div>
<div style="display: inline;" id="flash">FLAS H</div>
</body>
</html>

Apr 19 '06 #3
yeah....i knew this would be something simple. Lower case D. Thats
all it took. Works exactly how i wanted it to...now to add netscape
and older IE versions.

I guess ive just typed it so many times that when i copy and pasted it
5 times it should have been right the next 5 times. I know this
mistake wont happen again...

Thanks for the help. :)

Apr 19 '06 #4
re*******@gmail .com wrote:
okay ive been working at this for probably 4 hours now, and I (not to
mention my boss) am pretty upset.


Post a link - you'll get better results that way.
http://jibbering.com/faq/#FAQ2_3
http://jibbering.com/faq/#FAQ2_4
Apr 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
40655
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div style="display:none"> can be displayed by setting the style attribute to "display:", or hidden with "display:none". This gives the illusion that the person...
5
14646
by: Charles Blaquière | last post by:
As part of my explorations in liquid design, I'm exploring ways to use the overflow: hidden property -- when browser windows become too narrow, I want (some) images to get cropped rather than have the layout break up. In some cases, losing parts of images can be an interesting option. http://www.hebig.org/blog/titlepic.php was the first...
2
5284
by: Jon | last post by:
Hi all, I am trying to create a page that contains a number of div elements, with links on the left side of the page allowing the user to select which div to display. Some of the pages contain tables with border styles used to block off the columns and the headers, but not the individual rows. The pages will be displayed using IE 5.5 and...
2
2619
by: D. Alvarado | last post by:
Hello I have 5 divs, and initially the lower 4 are hidden. I would like everything beneath the 5th div to appear flush against the first visible div. But right now, there is a gap of white space between the first visible div, and everything beneath the 5th. Here is this code: <form name="f"> <div id="Item0">Item 1:<input type="text"...
4
5453
by: lawrence | last post by:
Can anyone tell me why this code works in Netscape 7.1 but not in IE??? <SCRIPT type='text/javascript'> function makeVisible(nameOfDiv) { document.getElementById(nameOfDiv).style.visibility='visible'; document.getElementById(nameOfDiv).style.height='auto'; if (nameOfDiv != 'weblogs')
1
12090
by: tabert | last post by:
I want to use JavaScript when a button is clicked to show and hide a SPAN or DIV. This works in both IE and Netscape, but what I'd like to happen is for there to be no white space where the hidden div is. I start with two visible divs and in between them are two more hidden ones...in Firefox this works fine--the two visible ones are right...
10
1939
by: web_design | last post by:
I'm making a form that is hidden until someone clicks on a link to open it. I can hide the form, but there is just a large white space on the screen where the form is hiding. Is there any way to close the white space when the form is not showing? At the moment I'm using a <div> and hiding the visibility, and then making it visible when the...
3
1740
by: gimme_this_gimme_that | last post by:
Depending upon a radio button button's setting a div is either hidden or visible. It turns out that the default view of the page requires that the div be hidden. When the user opts for the setting that makes the div visible, clicks, and then clicks the back button the page renders with the div hidden. I've tried a few strategies to...
2
15544
by: esteuart | last post by:
I need to get the right combination for a div to clip any text inside and allow vertical alignment. I only have this problem in FireFox. I have 3 divs nested within each other. The outer div has display of table, the first inner div has display of table-cell and the inner-most div has the text. The outer div has a set width and height. So...
0
7686
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7903
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6272
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5488
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3648
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3630
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1205
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.