简体   繁体   中英

scroll fixed navigation height percent

I am trying to fix my vertical navigation on the left side of my site.

$(document).ready(function(){

    $(window).scroll(function(){
        var border = 150;
        if($(window).scrollTop() >= border){
            $("#box_CATEGORIES").css({
                    'position' : 'fixed',
                    'top' : '0'

            });
        }
        if($(window).scrollTop() < border){
            $('#box_CATEGORIES').removeAttr('style');
        }
    })

});

This worked first fine but now I changed the height of my site in 100% because i want the footer always on bottom of the site.

And because of that ( I think ) the code doesnt work anymore.. :( any help?

The solution is to remove the overflow-x:hidden from the body element.

@James Khoury answered on similar Question by:

If you are using visible for either overflow-x or overflow-y and something other than visible for the other. The visible value is interpreted as auto.

Also you can find this jQuery open issue on github

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM