Response title
This is preview!
$(".navbar-brand").click(function () { var windowWidth = $(window).width(); if (windowWidth > 500) { var width = $(".sidePanel").width(); width = width * -1; if ($(".sidePanel").hasClass('active')) { $(".sidePanel").removeClass('active'); $(function () { $(".sidePanel").animate({ left: width }, 500); $(".container").animate({ left: width, width: windowWidth }, { duration: 500, queue: false }); }); } else { $(".sidePanel").addClass('active'); $(function () { $(".sidePanel").animate({ left: 0 }, { duration: 500, queue: false }); $(".container").animate({ left: 0, width: windowWidth * .85 }, { duration: 500, queue: false }); }); $("#notifBadge").html(""); } } else { $(".sidePanel").slideToggle(); } });
<a class="navbar-brand" href="#"><img src="../../Content/images/notification128.png"id="notificationIcon" height="32" width="32" alt="Notifications" /><span id="notifBadge" class="badge">3</span></a>
<div class="sidePanel"> NOTIFICATION AREA </div>
CSS
.sidePanel { margin: 0 10px 0 0; padding: 0; background-color: #2780E3; width: 15%; min-height: 100%; position: absolute; z-index: 10001; left: -15%; float: left; }
.container { float: right; width: 100%; }
© 2013 jQuery Foundation
Sponsored by and others.