1) I am currently working on a vertical menu layout and have successfully placed an image in the top right corner that allows users to adjust the width of the menu. However, I am facing an issue where I have to click on the same image to restore the menu to its original position after resizing.
2) I am also looking for a solution to change the size of the menu image when the menu is in a smaller position. If you can help me with this, please refer to the code snippet provided below for reference. Thank you!
$(document).ready(function() {
// Show hide popover
$(".active-dropdown").click(function() {
$(this).find(".left-menu-dropdown").slideToggle("fast");
});
});
$(document).ready(function() {
$('#slide-left-menu').click(function() {
$(".left-menu").animate({
width: '100px'
}, 'slow', 'linear', function() {
$('.left-menu-list ul li span').remove();
});
})
});
html,
body {
margin: 0;
padding: 0;
height: 100%;
}
.left-menu {
background-color: #ff0000;
width: 37%;
height: 100%;
z-index: 4;
}
.left-menu .inside-left-menu {
padding: 20px 15px;
}
.left-menu .left-menu-logo img {
width: 50px;
}
...(remaining CSS code)...
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<div class="left-menu">
<div class="minimize-left-menu">
<img src="https://d30y9cdsu7xlg0.cloudfront.net/png/66344-200.png" id="slide-left-menu">
</div>
...(remaining HTML code)...