Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > how to not hide a division

Reply
Thread Tools

how to not hide a division

 
 
richard
Guest
Posts: n/a
 
      11-02-2008
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.getElementById('hide2').style.display ==
document.getElementById('home1').style.display){
document.getElementById('hide2').style.display = "none";
} else {
document.getElementById('hide2').style.display =
document.getElementById('home1').style.display
}
}


 
Reply With Quote
 
 
 
 
SAM
Guest
Posts: n/a
 
      11-02-2008
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.getElementById('hide2').style.display ==
> document.getElementById('home1').style.display){
> document.getElementById('hide2').style.display = "none";
> } else {
> document.getElementById('hide2').style.display =
> document.getElementById('home1').style.display
> }
> }
>
>


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

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

function ShowHide(){
var hide = document.getElementById('hide2').style;
if(document.getElementById('home1').style.display != '')
hide.display = hide.display==''? 'none' : '';
}

--
sm
 
Reply With Quote
 
 
 
 
Doug Gunnoe
Guest
Posts: n/a
 
      11-03-2008
> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
show/hide any division richard Javascript 2 10-28-2008 03:21 AM
division by 7 without using division operator krypto.wizard@gmail.com C Programming 94 02-09-2007 06:57 AM
[HIDE LAN] Hide a part of hosts into the LAN at VPN users? Paolo Bresi Cisco 1 04-04-2005 02:41 PM
futue feature division not found (embedded) Jive Python 5 11-28-2004 02:21 PM



Advertisments