How make this studiompls . com/case-studies/crown-maple/?
My idea is: when scroll my site, this header change from this.
My website link: altnewspaper.com
Many thanks!
use proper classes as per your html
<style>
.header{top: 0;left: 0;right: 0;}
</style>
<script>
$(document).ready( function() {
var topOfOthDiv = $(".header").offset().top;
$(window).scroll(function() {
if($(window).scrollTop() > topOfOthDiv) {
$(".header").css({"position":"fixed","float":"left"});
$(".search").css("display","none");
}else{
$(".header").css({"position":"static","float":"none"});
$(".search").css("display","block");
}
});
});
</script>
The way I do is to catch the scrolling, and if I pass over the heading, I change class to header to get the fixed style, and same thing reverse. Here is the example...
You can of course add animation if you want on top of this...