$(document).ready(function () {
$("#toggle").click(function () {
if ($(this).data('name') == 'show') {
$("#sidebar").animate({
width: '10%'
}).hide()
$("#map").animate({
width: '89%'
});
$(this).data('name', 'hide')
} else {
$("#sidebar").animate({
width: '29%'
}).show()
$("#map").animate({
width: '70%'
});
$(this).data('name', 'show')
}
});
});
html, body {
width:100%;
height: 100%;
}
#header {
width: 100%;
height: 20%;
float: left;
border: 1px solid;
}
#map {
width: 80%;
height: 80%;
float: left;
border: 1px solid;
}
#sidebar {
width: 19%;
height: 80%;
float: left;
border: 1px solid;
}
#toggle {
width: 10%;
height: 40%;
margin-right: 6.5%;
margin-top: 3.5%;
float: right;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="header">HEADER
<input type="button" data-name="show" value="Toggle" id="toggle">
</div>
<div id="map">MAP</div>
<div id="sidebar">SIDEBAR</div>
I am just starting out with angularjs
, jquery
, and css
. I'd like to arrange three divs with a toggle side by side. Can anyone provide guidance on how to achieve this in angularjs?
In the regular mode, it should look like the following:
https://i.stack.imgur.com/Ma3HG.jpg
This is how it would appear.
If I extend the center div, it should look like the following example:
https://i.stack.imgur.com/ej7V7.jpg
If I expand the last div, it should resemble this example:
https://i.stack.imgur.com/QbW8S.jpg
Thank you!