two header and display one only when pageyoffset is zero code example Example: pageyoffset jquery $(window).scrollTop()