<div class="b-caption">
<div class="caption" id="c-1">
<p>1</p>
</div>
<div class="caption" id="c-2">
<p>2</p>
</div>
<div class="caption" id="c-3">
<p>3</p>
</div>
</div>
<script>
$(document).ready(function () {
// Closes the sidebar menu
$("#menu-close").click(function(e) {
e.preventDefault();
$("#sidebar-wrapper").toggleClass("active");
});
// Opens the sidebar menu
$("#menu-toggle").click(function(e) {
e.preventDefault();
$("#sidebar-wrapper").toggleClass("active");
});
// Scrolls to the selected menu item on the page
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') || location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
</script>
<script src="js/bootstrap.min.js"></script>
var uri = location.pathname;
localStorage.setItem(uri, newText); // ключ локального хранилища url данной страницы
if(localStorage.getItem(uri)) // ищем ключ такой же как url нашей страницы