- PUBLIC"-//W3C//DTD Xhtml 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- 0px}
- window.onscroll =function(){
- vard = document.getElementById("menu");
- if(window.scrollY >= 100)
- {
- d.style.position = "fixed";
- d.style.top = "0px";
- }
- else
- {
- d.style.position = "relative";
- }
- }
- function gun()
- {
- window.scrollTo(0,100);
- }
来源: http://www.bubuko.com/infodetail-1978002.html