How can i give space between navbar fixed with div
Hello Guys i'm creating website that has feature one page, i have been figure it and succesfully scroll and fixed the nav bar, but now i face problem that when i click the href page scroll go away not as wish, i mean in this issue my page go the top it make not good looking for user, My wish now how can i give some space or height between my navbar and div, Thanks
this is my jquery
- // for fixed menu
- $(document).ready(function() {
- $(window).scroll(function () {
- console.log($(window).scrollTop())
- if ($(window).scrollTop() > 500) {
- $('#nav_bar').addClass('navbar-fixed');
- }
- if ($(window).scrollTop() < 500) {
-
- $('#nav_bar').removeClass('navbar-fixed');
-
- }
- });
- });
-
-
-
- //for click href
- jQuery(document).ready(function(){
- jQuery('a[href^="#"]').click(function(e) {
- jQuery('html,body').animate({
- scrollTop: jQuery(this.hash).offset().top}, 800);
- return false;
- e.preventDefault();
- });
- });
-
-