Implementing Show Hide of a Div

  • 9 years ago

    hi all,

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

    #divholder1

    {

    float:left;

    width:75%;

    height:450px;

    }

    #divholder2

    {

    float:right;

    width:24%;           /* remaining 1% is used as a gap between the two <Div> tags */

    height:450px;

    }

    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

  • 9 years ago

    make your divs - 'Run as Server control'

    <div id="divholder1" runat="server" style="width: 616px; height: 272px">

     

    on your button click event set div visible property

    divholder1.visible = true

    divholder2.visible = false

     

    ==Postmaster

    http://www.programmingknowledge.com/ 

     

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” - Brian Kernighan