I am trying to make the bottom drawer slider with a good look.
A round button will be fixed at the bottom of the page, and only half of it should be shown when the box is closed (half circle), and click on it to expand the box
Silent Chart:
_____________________________
| Web Page |
| |
| |
| ____ |
|__________/ /\ \___________| < Closed (bottom of browser window)
_____________________________
| Web Page |
| ____ |
|__________/ /\ \___________| < Opened
| \____/ |
|___________________________|
JsFiddle: https://jsfiddle.net/ppgab/wcec9gc6/4/ (I use semantic ui, but this is optional)
How can I show only half the button when the drawer is closed?
HTML
<div>Page content</div>
<div id="map" class="down">
<div>
<i class="ui circular link expand big inverted icon"></i>
</div>
bottom slider content
</div>
CSS
#map {
background-color: #303030;
width: 100%;
text-align: center !important;
height: 4%;
bottom: 0;
position: fixed;
}
Javascript / jquery
$('.icon').click(function() {
if ($("#map").hasClass("down")) {
$("#map").removeClass("down");
$("#map").animate({
height: "50%"
}, 600);
} else {
$("#map").animate({
height: "4%"
}, 350);
$("#map").addClass("down");
}
});
It would be even better to use percentage sizes.
source
share