Expandable Left Side Bar with jQuery animate

Size
2,483 Kb
Views
4,048

How do I make an expandable left side bar with jquery animate?

The animation as the left side bar slides right uses jquery animate instead of css. What is a expandable left side bar with jquery animate? How do you make a expandable left side bar with jquery animate? This script and codes were developed by Retrofuturistic on 19 January 2023, Thursday.

Expandable Left Side Bar with jQuery animate Previews

Expandable Left Side Bar with jQuery animate - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Expandable Left Side Bar with jQuery animate</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="page"> <div class="sidebar"> <h2>TC</h2> <ul> <li><span class="leader">A</span><span class="detail">gency</span></li> <li><span class="leader">S</span><span class="detail">tories</span></li> <li><span class="leader">C</span><span class="detail">ase Studies</span></li> </ul> </div> <div class="content"> <p>	Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Expandable Left Side Bar with jQuery animate - Script Codes CSS Codes

body{ margin:0; padding:0; background:#eee;
}
.page { margin:0; padding:0; }
.sidebar { position:fixed; top:0; left:0; height:100%; width:50px; background:#666; font-family:sans-serif; color:#fff; -webkit-transition: width 0.5s linear; overflow:hidden;
}
.sidebar h2 { padding-left:7px;
}
.sidebar ul { list-style:none; padding:0; margin:0;
}
.sidebar ul li { display:block; border-top:1px solid #999; overflow:hidden; padding:10px; height:20px; width:150px; overflow:hidden;
}
.sidebar ul li:last-child { border-bottom:1px solid #999;
}
.sidebar span.leader { opacity:1; width:7px; font-weight:bold;
}
.sidebar span.detail{ opacity: 0;
}
.content { position:relative; left:52px; padding-left:20px; width:600px; margin-left:auto; margin-right:auto; margin-top: 50px; -webkit-transition: left 0.5s linear;
}

Expandable Left Side Bar with jQuery animate - Script Codes JS Codes

$('.sidebar').mouseenter(function(e) { //slide the drawer $('.sidebar').animate({width: "150px"},200,"linear"); //show the draw elements $('.sidebar span.detail').animate({opacity: 1},400,"linear"); //slide the content $('.content').animate({left:"150px"},200,"linear");
});
$('.sidebar').mouseleave(function(e) { //slide the drawer $('.sidebar').animate({width: "50px"},200,"linear"); //show the draw elements $('.sidebar span.detail').animate({opacity: 0},400,"linear"); //slide the content $('.content').animate({left:"52px"},200,"linear");
});
Expandable Left Side Bar with jQuery animate - Script Codes
Expandable Left Side Bar with jQuery animate - Script Codes
Home Page Home
Developer Retrofuturistic
Username retrofuturistic
Uploaded January 19, 2023
Rating 3
Size 2,483 Kb
Views 4,048
Do you need developer help for Expandable Left Side Bar with jQuery animate?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Retrofuturistic (retrofuturistic) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!