harry_ord Posted October 25, 2016 Share Posted October 25, 2016 Hello In this Wordpress theme the nav menu changes when you scroll-down the page. At the begining is transparent and big, but then it gets smaller and white. http://feriapixel.cl/wordpress/ How can i do that myself? Link to comment Share on other sites More sharing options...
dsonesuk Posted October 25, 2016 Share Posted October 25, 2016 JavaScript is used to identify current scroll position of window, when it reaches a certain point a css class is added, to trigger css animation or transition. Link to comment Share on other sites More sharing options...
harry_ord Posted October 26, 2016 Author Share Posted October 26, 2016 I did it, chum. http://feriapixel.cl/befirm/ This was the function used: $(window).scroll(function() { var height = $(window).scrollTop(); if(height > 400) { $(".navbar-inverse").css("display", "block"); } else { $(".navbar-inverse").css("display", "none"); } }); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now