473,395 Members | 1,348 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,395 software developers and data experts.

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>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script src="AC_RunActiveContent.js" language="JavaScript"
type="text/javascript"></script>
<script src="AC_Flash.js" language="JavaScript"
type="text/javascript"></script>
<script>
function show0(){
document.getElementByID('shift').style.visibility = 'visible';
}
function hide0(){
document.getElementByID('shift').style.visibility = 'hidden';
}
function show1(){
document.getElementByID('flash').style.visibility = 'visible';
}
function hide1(){
document.getElementByID('flash').style.visibility = 'hidden';
}
function doTimer() {
var timeout
timeout = setTimeout("show1();hide0();", 30000);
}

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

<body>
<div style="position:absolute;top:0px;left:0px;visibili ty:hidden;"
id="shift"> <img src="pics/dvd.jpg" width="300" height="220"
name="main"> </div>
<div style="position:absolute;top:0px;left:0px;visibili ty:visible;"
id="flash">
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
width="300" height="220">
<param name="movie" value="shift.swf">
<param name="quality" value="high">
<embed src="shift.swf" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="300"
height="220"></embed></object>
</noscript>
<script language="JavaScript" type="text/javascript" >
<!--
AC_RunFlContentX ("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 2323
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.getElementById('shift').style.display = 'inline';
document.getElementById('flash').style.display = 'none';
}

function ShowIt() {
document.getElementById('shift').style.display = 'inline';
document.getElementById('flash').style.display = 'none';
}

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

</script>
</head>
<body onload=doTimer()>
<div style="display:none;" id="shift">SHIFT</div>
<div style="display:inline;" id="flash">FLASH</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
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...
5
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...
2
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...
2
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...
4
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) {...
1
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...
10
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...
3
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...
2
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...
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?
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.