473,834 Members | 1,503 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 2358
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
40781
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 filling out the form is switching from page to page...without the overhead of extra hits on the server,...
5
14671
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 example I found, and it's quite nifty. His image works well when progressively cropped from the right,...
2
5293
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 later in the finished app. Now to the problem, which is a little awkward to describe:
2
2647
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" size="32" maxlength="32" name="Name0" id="Name0"></div>
4
5489
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
12121
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 next to each other, the button fires the script and the other div shows up in the middle. Another...
10
1962
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 link is clicked: <div id="form" style="visibility: hidden; etc...
3
1752
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 handle this. Adding no-cache meta tags
2
15578
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 here's the problem: Without the inner divs having a width and height set, the overflow:hidden doesn't...
0
9796
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10789
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10504
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10544
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10214
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5624
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5790
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3079
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.