เมนูเว็บไซต์เปลี่ยน เมื่อ scroll mouse
http://demo.themegrill.com/himalayas/
<style type="text/css">
body{
margin:0;padding:0;
min-height:2000px;
}
nav{
position:absolute;
top:0;
width:100%;
height:100px;
background-color:blue;
}
.fixed{
position:fixed;
background-color:red;
}
</style>
<nav id="nav"></nav>
<script type="text/javascript">
function fixed(){
var nav = document.getElementById("nav");
var body = document.getElementById("body");
if(window.pageYOffset>100){ /* เมื่อ Scroll ห่างจากด้านบน 100px */
nav.className="fixed"; /* ให้เพิ่มคลาส fixed ให้กับ ไอดี nav */
}else{ /* หากไม่อยู่ในเงื่อนไข */
nav.className=""; /* ลบคลาส fixed ออกจาก ไอดี nav โดย set คลาส ให้เป็นค่าว่าง*/
}
};
window.onscroll = fixed;
</script>