Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
154
rated 0 times [  159] [ 5]  / answers: 1 / hits: 48584  / 12 Years ago, wed, june 13, 2012, 12:00:00

How to maximize and minimize a div? Can I resize div according to as need?


More From » html

 Answers
9

I think you need something like this



http://jsfiddle.net/miqdad/Qy6Sj/1/



You can view the code in jsfiddle here is the code what I have done created a div with another div inside as title bar and content box



html



<div id=widnow>
<div id=title_bar>
<div id=button>-</div>
</div>
<div id=box>
</div>
</div>


css



#widnow{
width:400px;
border:solid 1px;
}

#title_bar{
background: #FEFEFE;
height: 25px;
width: 100%;
}
#button{
border:solid 1px;
width: 25px;
height: 23px;
float:right;
cursor:pointer;
}
#box{
height: 250px;
background: #DFDFDF;
}


jquery



$(#button).click(function(){
if($(this).html() == -){
$(this).html(+);
}
else{
$(this).html(-);
}
$(#box).slideToggle();
});

[#84943] Tuesday, June 12, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
braydon

Total Points: 0
Total Questions: 102
Total Answers: 111

Location: Sao Tome and Principe
Member since Wed, Dec 29, 2021
2 Years ago
;