Solved

could not get visibility property

Posted on 2006-11-18
6
1,162 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

726 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