473,811 Members | 3,462 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to not hide a division

In using the simple code below, how do I tell it NOT to hide a
division when the link is clicked on if that division is already
visible?

would it be as simple as using a 2nd function and setting that to
"display" rather than "none"?

For instance, "home" is showing. The user clicks on "home".
I don't want the division to do anything at all.
function ShowHide(){

if (document.getEl ementById('hide 2').style.displ ay ==
document.getEle mentById('home1 ').style.displa y){
document.getEle mentById('hide2 ').style.displa y = "none";
} else {
document.getEle mentById('hide2 ').style.displa y =
document.getEle mentById('home1 ').style.displa y
}
}
Nov 2 '08 #1
2 2545
SAM
Le 11/2/08 10:27 PM, richard a écrit :
In using the simple code below, how do I tell it NOT to hide a
division when the link is clicked on if that division is already
visible?

would it be as simple as using a 2nd function and setting that to
"display" rather than "none"?

For instance, "home" is showing. The user clicks on "home".
I don't want the division to do anything at all.
function ShowHide(){

if (document.getEl ementById('hide 2').style.displ ay ==
document.getEle mentById('home1 ').style.displa y){
document.getEle mentById('hide2 ').style.displa y = "none";
} else {
document.getEle mentById('hide2 ').style.displa y =
document.getEle mentById('home1 ').style.displa y
}
}

don't know too much what could be this 'division' ...

function ShowHide(){
var home = document.getEle mentById('home1 ').style;
var hide = document.getEle mentById('hide2 ').style;
hide.display = home.display==' '? hide.display :
hide.display==' '? 'none' : '';
}

function ShowHide(){
var hide = document.getEle mentById('hide2 ').style;
if(document.get ElementById('ho me1').style.dis play != '')
hide.display = hide.display==' '? 'none' : '';
}

--
sm
Nov 2 '08 #2
don't know too much what could be this 'division' ...

I didn't see the term 'division' in regard to 'div' in HTML 4
specification, but I think that most assume that's what it means.
Nov 3 '08 #3

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

Similar topics

27
12049
by: Fuli Chang | last post by:
I don't like other people see my html code. Is there a way to hide it? Thanks.
2
2726
by: Pat Scott | last post by:
I am looking for a general purpose javascript snippet that enables me to <div> or <span> HTML to make portions of the form be hidden and then appear. The form contains about 12 sections and some sections can contain subsections. When the user clicks on a checkbox, I want previously hidden text boxes, radio buttons, text, drop down menus, and additional checkboxes to appear. In some cases, clicking on a checkbox in a section can cause...
17
2436
by: seb.haase | last post by:
Hi, Is it true that that "Python 3000" is dead ? Honestly I think that e.g. changing 5/2 to be 2.5 (instead of 2) would just break to much code :-( On the otherhand I'm using Python as "Matlab replacement" and would generally like 5/2 ==2.5 So, I was contemplating to default all my modules/scripts to start with "from __future__ import division" but if it is never coming (in this decade, that is) then it would be a
2
3877
by: kermit | last post by:
For a long time,, There has been a discussion of trueFor division versus integer division in Python. I myslef prefer that / be used for integer division since almost always, I want the result of the division be truncated to integer. However, today I reviewed the method to be used in Python to get true division, and this gave
13
7129
by: jamesonang | last post by:
Supposed unsigned int(32 bits) is the largest number that computer can represent with a single variable. Now, i have a big integer ( less than 64 bit, but great than 32 bit) . i represent it by this way: unsigned int dividend : divident store low 32 bits of big integer, dividend store high 32 bits of big integer.
11
19234
by: C.W.Holeman II | last post by:
I what to hide an input element and the following text. I have the selector for the input working and just need to grab the text following it. CSS: form{ display:table; text-align:center; }
2
2756
by: richard | last post by:
I'm working on a menu system where I have a 3 column table affair. On start, you see a menu list in column 1. Column2 will have some general information. Column3 is an iframe for final data input. About every damn thing I've seen on how to do this is the pure bare bones basics. That is, click button 1 to hide, click button 2 to show. Not what I want. Or, they simply toggle a division below the "switch".
5
2980
by: question.boy | last post by:
I am trying to control the visibility of a set of div based on selected values but can't seem to get it right. Below is what I have so far but it does not work at all. The basic concept was to have a set of Divs A through Z and by click the associated text character that Div would be visible and all others would be hidden. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://...
0
9734
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
9607
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10656
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
9214
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7674
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5564
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
5700
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4353
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
3
3027
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.