Line 174: | Line 174: | ||
<!------------------------------------------------整屏翻页-------------------------------------------------------> | <!------------------------------------------------整屏翻页-------------------------------------------------------> | ||
+ | <script> | ||
+ | function jump1(){document.getElementById("jp1").click();} | ||
+ | function jump2(){document.getElementById("jp2").click();} | ||
+ | function jump3(){document.getElementById("jp3").click();} | ||
+ | function Design(){ | ||
+ | var url="https://2016.igem.org/Team:Jilin_China/Description" | ||
+ | string str = ""; | ||
+ | if(Request.Url.ToString().IndexOf("?")<0) | ||
+ | { | ||
+ | str = Request.Url.ToString(); | ||
+ | |||
+ | } | ||
+ | else | ||
+ | { | ||
+ | str = Request.Url.ToString().Substring(0, Request.Url.ToString().IndexOf("?")); | ||
+ | |||
+ | } | ||
+ | if(str==url){ | ||
+ | jump2(); | ||
+ | |||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | |||
+ | </script> | ||
<!------------------------ping----------------------------------menu-------------------------------------------------> | <!------------------------ping----------------------------------menu-------------------------------------------------> | ||
Line 186: | Line 211: | ||
<ul> | <ul> | ||
<li><a href="https://2016.igem.org/Team:Jilin_China/Description?openId=jp1" >Background</a></li> | <li><a href="https://2016.igem.org/Team:Jilin_China/Description?openId=jp1" >Background</a></li> | ||
− | <li><a href="https://2016.igem.org/Team:Jilin_China/Description?openId=jp3" >Design</a></li> | + | <li><a href="https://2016.igem.org/Team:Jilin_China/Description?openId=jp3" onClick="Design()" >Design</a></li> |
</ul> | </ul> | ||
Line 263: | Line 288: | ||
}; | }; | ||
+ | function preventBodyScroll(event){ | ||
+ | var event = event.originalEvent || event; | ||
+ | if (event.wheelDelta < 0 || event.detail > 0) { // 向下滚动 | ||
+ | if (this.scrollTop + this.clientHeight < this.scrollHeight) { // 未滚动到底 | ||
+ | event.stopPropagation(); // 阻止事件继续冒泡 | ||
+ | } | ||
+ | } | ||
+ | else { // 向上滚动 | ||
+ | if (this.scrollTop > 0) { // 未滚动到顶 | ||
+ | event.stopPropagation(); // 阻止事件继续冒泡 | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // document.getElementById('c1').addEventListener('mousewheel', preventBodyScroll, true); | ||
+ | // document.getElementById('c1').addEventListener('DOMMouseScroll', preventBodyScroll, true); | ||
+ | $('#c1').on('mousewheel DOMMouseScroll', preventBodyScroll); | ||
+ | |||
</script> | </script> | ||
</div> | </div> |
Revision as of 13:45, 16 October 2016