dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Fixednav after scroll down is not working in mozzila firefox

  1. #1
    Join Date
    May 2017
    Posts
    1

    Angry Fixednav after scroll down is not working in mozzila firefox

    Hi all,

    I have java script to make my nav bar fixed after scroll down. It works perfectly on chrome and opera without problem, but is not working in mozzila firefox.


    function scrollFunction() {
    var scrollPos = document.body.scrollTop;

    if (scrollPos > 40) {
    document.getElementById("fixednav").style.position = "fixed";
    document.getElementById("fixednav").style.top = "0px";


    } else {
    document.getElementById("fixednav").style.position = "absolute";
    document.getElementById("fixednav").style.top = "40px";


    }
    }

    window.onscroll = scrollFunction;



    Please help.

  2. #2
    Join Date
    Oct 2013
    Location
    Sheboygan, Wisconsin
    Posts
    1,493
    It sure would help if you used thee BBcode
    http://www.webdeveloper.com/forum/misc.php?do=bbcode

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles