Solved

could not get visibility property

Posted on 2006-11-18
6
1,155 Views
Last Modified: 2008-01-09
hi, I have set of divs:  
<div id=$i'  style='visibility:collapse' ></div> and:

function show_comment(param) {
      if(window.prev_tag)  prev_tag.innerHTML = ' ';

      document.getElementById(paramt).innerHTML = 'some_txt';      
      window.prev_tag = document.getElementById(param);
}

the problem: when  I click another link  the previous div became empty as expected BUT doest collapse.

is there a way to force the div to return to its initial style'  ie :  <div id=$i'  style='visibility:collapse' ></div>



0
Comment
Question by:uk1900
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:jay_gadhavi
ID: 17971168
u can use : this.style.visibility='hidden' for hiding the div or this.style.visibility=' ' for visible the div.

Like example

<a style="color:black;" href="javascript:void(0);"
onclick="this.style.visibility='hidden';">
Click on me, monkey.
</a>

I think it may solved your proble,
Regards,
jay


0
 

Author Comment

by:uk1900
ID: 17971202
thx jay_gadhavi

yes it hides the div but doesnt collapse.

if u click now u still have an empty line between AAAA and BBBB.
-----------------
AAAA
<div style="color:black;" href="javascript:void(0);"
onclick="this.style.visibility='hidden';">
Click on me, monkey.
</div>
BBBBB
-----------------------
0
 
LVL 41

Accepted Solution

by:
HonorGod earned 500 total points
ID: 17971265
the visibility tells the browser to keep the item space there.  If you want to have div collapsed, you need to use:

  style="display:none"
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 41

Expert Comment

by:HonorGod
ID: 17971266
0
 

Author Comment

by:uk1900
ID: 17971372
thx HonorGod  it works.
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 17978913
Great.  Thanks for the 'A'.  Good luck
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now