Reputation: 601
I am using in my html code the automatic menu accordition of Ujquery. The site is here
I managed in my css file to adjust the width of it with the following code:
.menu{
position: absolute;
top: 5%;
left: 10%;
width: 80%;
background-color: blue;
}
Why the width parametre works great and the height not? I want to set all this menu to 50% of my available space. Thank you for your time in advance.
Upvotes: 0
Views: 81
Reputation: 16170
If you are just trying to get the accordion to fill a given amount of space on your page. Try this-
http://jsfiddle.net/apaul34208/GxVYN/1/
js
$(function () {
$("#accordion").accordion({
heightStyle: "fill"
});
});
css
body {
height:500px;
}
.container {
height:50%;
}
Upvotes: 1
Reputation: 601
Thank you for your time.
I solve it following the code here:
Was my mistake not to look all the javascript documentation! Thank you for you time once more!
Upvotes: 0
Reputation: 18705
.ui-accordion-content{height:50%;position:relative;}
Don't initialize heightStyle at all.
$(function() {
$( "#accordion" ).accordion({
});
});
Fiddle: http://jsfiddle.net/calder12/h8KhV/2/
Upvotes: 1