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

hide/show hyperlinks

Hi all,

what i'm doing is showing/hiding hyperlinks depending on the hyperlink clicked. it is partially working. when i call step1, all hyperlinks are hidden. but then i call step2, single and mulitple is visible. the problem is when i call step1 again, it does not hide single and multiple hyperlinks. any idea to solve my problem? thanks in advance! below is my sample script...

function Step1()
{
document.all.disappear.style.visibility = "hidden";
}
function Step2(single, multiple)
{
document.all.disappear.style.visibility = "hidden";
document.getElementById(single).style.visibility = "visible";
document.getElementById(multiple).style.visibility = "visible";
}

by the way, i used <span id="disappear"> to hide the hyperlinks...
Jun 4 '07 #1
3 2847
iam_clint
1,208 Expert 1GB
when hiding the links I would hide them individually instead of in a span or div
using code something like this. then unhide individual links.
Expand|Select|Wrap|Line Numbers
  1. var links = document.getElementsByTagName("A");
  2. for (i=0; i<links.length; i++) { 
  3.  links[i].style.visibility = "hidden";
  4. }
  5.  
Jun 4 '07 #2
when hiding the links I would hide them individually instead of in a span or div
using code something like this. then unhide individual links.
Expand|Select|Wrap|Line Numbers
  1. var links = document.getElementsByTagName("A");
  2. for (i=0; i<links.length; i++) { 
  3.  links[i].style.visibility = "hidden";
  4. }
  5.  
hi clint

i'm using asp .net. i used asp to create the hyperlinks. im having a hard time getting the controls in asp and manipulate them in javascript. when i set the property of hyperlinks (around 20) to visible = false in asp .net (on page load, i want almost all links to be hidden. then by clicking a link, some links should be visible and others should be hidden), i can not set it to visible using javascript...
Jun 5 '07 #3
iam_clint
1,208 Expert 1GB
your server side app has nothing todo with this. So if that code don't work for you show me your code and I will continue to help you.

visible = false is wrong
visibility = 'hidden'; is right
and to make them visible is
visibility = 'visible';
Jun 5 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Steve | last post by:
Visual Studio 2003 C# Windows: I have a tree view control as my main menu control down the left side of my application. This has 2 Parent Nodes on it (Jobs and Employees). beneath these 2 main...
5
by: Ray | last post by:
Hi, I was wondering if anyone has any idea how this can be done. I am trying to show/hide navigation links based on server names or ip addresses. So if, someone visits a particular url/ip address...
0
by: Efkas | last post by:
I have a full custom application with some widged extending Controls like Label and PictureBox. I build a menu with these widgets. When I click on one of them, it calls a function to display...
5
by: Patrick.O.Ige | last post by:
What are the best ways to hide hyperlinks from visitors? Any ideas
4
by: bridgemanusa | last post by:
Hi All: I have a very long page of html that I want to take portions and hide them in divs, then show when a link is clicked. I have the hide show part working when the link is clicked, however...
2
by: prefersgolfing | last post by:
Is there a way to hide the query string in the address bar?
7
by: FP | last post by:
I'm new to Java Script. I'm displaying comments people have made. Below each persons' comment I want to add 2 buttons "Reply" and "Amend". Clicking "Reply" would display an empty text field...
5
by: ali | last post by:
Hello every one i need you help regarding div hide and show. i am having a link like <a href="#" onClick="expandWin()">show/hide </a> <div id=showHide> </div> within div i have lots of...
1
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.