Difference between revisions of "Team:SCUT-China A"

Line 3: Line 3:
  
 
<html>
 
<html>
<script src="http://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
 
    crossorigin="anonymous"></script>
 
  
 
<style type="text/css">
 
<style type="text/css">
Line 751: Line 749:
 
         //DOMMouseScroll事件中的 “event.detail” 属性值:返回的如果是负值说明滚轮是向上滚动
 
         //DOMMouseScroll事件中的 “event.detail” 属性值:返回的如果是负值说明滚轮是向上滚动
 
         if ((endTime - startTime) < -1000) {
 
         if ((endTime - startTime) < -1000) {
            if (delta > 0 && parseInt(main.offsetTop) > -(hei * 2)) {
+
          if(delta > 0){
                //向下滚动
+
                if( parseInt(main.offsetTop) > -(hei * 2) ){
                now = now - hei;
+
                    now = now - hei;
                toPage(now);
+
                    toPage(now);
 +
                }
 
             }
 
             }
             if (delta < 0 && parseInt(main.offsetTop) < 0) {
+
 
                //向上滚动
+
             if(delta < 0 ){
                now = now + hei;
+
                if(parseInt(main.offsetTop) < 0 ){
                toPage(now);
+
                    now = now + hei;
 +
                    toPage(now);
 +
                }
 
             }
 
             }
 
             endTime = new Date().getTime();
 
             endTime = new Date().getTime();

Revision as of 09:31, 31 October 2017