There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen boot bsod computer connection crash css dell display drive driver drivers email error ethernet excel explorer firefox firefox 3 hard drive internet internet explorer itunes laptop lcd malware monitor network networking outlook outlook 2003 outlook express partition password printer problem problems ram router slow sound sprtcmd.exe trojan usb virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
show / hide in all browsers


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
fizzle's Avatar
Junior Member with 19 posts.
 
Join Date: Jun 2005
Experience: it depends on the topic
08-Dec-2005, 07:10 PM #1
show / hide in all browsers
I guess this is sort of a DHTML/CSS/JavaScript question.

I am trying to do pretty much exactly what is being done here:

http://simplythebest.net/scripts/DHT...script_26.html

The problem is, it doesn't work in Mozilla or Firefox.

Is it possible to do this and have it work in all browsers?

I've searched around, but I haven't had any luck finding anything yet.
Maybe someone here can save me some time and let me know if it's even possible.

Thanks!!!
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
08-Dec-2005, 09:05 PM #2
Here's a sample
Code:
<script type="text/javascript">
function hideObj(objId)
{
  if (document.getElementById)
  {
    document.getElementById(objId).style.visibility = 'hidden';
  }
  else
  {
    if (document.layers)
    {
      document.objId.visibility = 'hidden';
    }
    else 
    {
      document.all.objId.style.visibility = 'hidden';
    }
  }
}
function showObj(objId)
{
  if (document.getElementById)
  {
    document.getElementById(objId).style.visibility = 'visible';
  } 
  else
  {
    if (document.layers)
    {
      document.objId.visibility = 'visible';
    }
    else
    {
      document.all.objId.style.visibility = 'visible';
    }
  }
}
</script>

<a href="javascript:showObj('myobject')">Show!</a>
<div id="myobject" style="visibility: hidden;">
This is a DIV.
<a href="javascript:hideObj('myobject')">Hide Me!</a>
</div>
Tested on Firefox 1.x, IE6, Opera 8.x, Netscape 8.x.

Last edited by brendandonhu : 08-Dec-2005 10:10 PM.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:52 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.