The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How can i give space between navbar and div

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #203683

    Hei Again, i was frustration about navbar fixed with scroll div when click navbar, first i use js sminth here is but i face problem

    make my navbar not responsive when small device not good looking

    so i decide to change plugin with this tutorial

    and make navbar fixed when scroll i add up this script found in some forum

    $(document).ready(function() {<br />
    var stickyNavTop = $(‘.nav’).offset().top;
    var stickyNav = function(){
    var scrollTop = $(window).scrollTop();

    if (scrollTop > stickyNavTop) {
    $(‘.nav’).addClass(‘sticky’);<br />
    } else {
    $(‘.nav’).removeClass(‘sticky’);<br />


    $(window).scroll(function() {

    this is my demo

    please kindly click one of href fasilitas, praktek, testimoni or kontak it give me not good looking,

    The point problem is first time click href always give div go away to the top (Sorry for bad explanation my english)

    how can i fixed that with add up space between navbar and div when scrolling, Thanks


Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.