By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

Div tags problem - Show 'n' Hide

P: 11
hi all,

I am having two <Div> tags on my web page. I am using a CSS file for the appearance of these tags :

Expand|Select|Wrap|Line Numbers
  1. #divholder1
  2.  
  3. {
  4.  
  5. float:left; 
  6. width:75%;
  7.  
  8. height:450px; 
  9. }
  10.  
  11. #divholder2
  12.  
  13. {
  14.  
  15. float:right; 
  16. width:24%;           /* remaining 1% is used as a gap between the two <Div> tags */
  17.  
  18. height:450px; 
  19. }
  20.  
What I want on my web page is to place a button, on whose click I want to hide "divholder2" and the width of "divholder1" should become 100%, so that I can make use of the whole width. And if I click the button again then it should show me "divholder2" along side "divholder1".



Regards,

Royal
Mar 19 '08 #1
Share this Question
Share on Google+
1 Reply


gits
Expert Mod 5K+
P: 5,390
to achieve that you have to use javascript ... just write and call a toggle-function that refers to the appropriate divs and set its display-style-property to none (to hide it) or block (to show it) ...

kind regards
Jul 9 '08 #2

Post your reply

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