在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/HTML5  HTML/ preventDefault 禁止根級(jí)div默認(rèn)事件 子級(jí)div滾動(dòng)條滾動(dòng)無(wú)效怎

preventDefault 禁止根級(jí)div默認(rèn)事件 子級(jí)div滾動(dòng)條滾動(dòng)無(wú)效怎么解決?

我寫(xiě)了一個(gè)頁(yè)面上下滑動(dòng)翻頁(yè),當(dāng)我手指放到中間有內(nèi)容的那個(gè)div范圍內(nèi)時(shí),禁止了touchmove事件,用的是{

                    //阻止默認(rèn)事件發(fā)生
                    e.preventDefault()
                    //阻止冒泡事件發(fā)生
                    e.stopPropagation()
                    e.nativeEvent.stopImmediatePropagation();}

但是中間那個(gè)div(有內(nèi)容的那個(gè))的滾動(dòng)條就無(wú)法在手機(jī)上滾動(dòng)了,在PC端電腦上可以滾動(dòng),請(qǐng)問(wèn)大神,這個(gè)怎么解決?代碼如下:
<html>

<head>

<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,minimum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<script src="/include/zenkee.js"></script>
<script>
    var PageSlide;

    function Page_Load() {
        Loadpage();
        showdatail();
    }

    function changeMusic() {
        if (document.getElementById('btnMusic').getAttribute("alt") == "停止音樂(lè)") {
            document.getElementById('emb').pause();
            document.getElementById('btnMusic').setAttribute("alt", "播放音樂(lè)");
        } else {
            document.getElementById('emb').play();
            document.getElementById('btnMusic').setAttribute("alt", "停止音樂(lè)");
        }
    }

    function showdatail() {
        $.json('/user/jsonSchoolById.asp?s_id=' + <#QS:id> , function (o) {
            for (var i = 0; i < o.length; i++) {
                $('park').innerHTML = o[i].park;
                $('about').innerHTML = o[i].about;
                $('address').innerHTML = o[i].address;
                $('purpose').innerHTML = o[i].purpose;
                $('target').innerHTML = o[i].target;
                $('object').innerHTML = o[i].object;
                $('time').innerHTML = o[i].s_time + '-' + o[i].e_time;
                $('slogan').innerHTML = o[i].slogan;
                $('enrolment_class').innerHTML = o[i].enrolment_class;
                $('promise').innerHTML = o[i].promise;
                $('charges').innerHTML = o[i].charges;
                document.getElementsByClassName('s_picture')[0].src = "http://8010.suyou188.com/p.asp?file=" + o[i].s_picture;
                document.getElementsByClassName('s_picture')[1].src = "http://8010.suyou188.com/p.asp?file=" + o[i].s_picture;
                document.getElementsByClassName('s_picture')[2].src = "http://8010.suyou188.com/p.asp?file=" + o[i].s_picture;
                document.getElementById('pictures').src = "http://8010.suyou188.com/p.asp?file=" + o[i].pictures;
                document.getElementsByClassName('contacts')[0].innerHTML = o[i].contacts;
                document.getElementsByClassName('contacts')[1].innerHTML = o[i].contacts;
                document.getElementsByClassName('phone')[0].innerHTML = o[i].phone;
                document.getElementsByClassName('phone')[1].innerHTML = o[i].phone;
            }
        });
    }

    /* 當(dāng)觸點(diǎn)坐標(biāo)在div范圍之類(lèi)執(zhí)行這個(gè)方法*/
    function addBan() {
        var odiv = document.querySelector('.center');
        var widthpoor = odiv.getBoundingClientRect().right - odiv.getBoundingClientRect().left;
        var heightpoor = odiv.getBoundingClientRect().bottom - odiv.getBoundingClientRect().top;
        var page = new PageSlide(document.querySelector('.pages'), 'Y', '');
        //var pageTart=new page.touchstart(page);
        alert(page.current);
    }

    function sbmChk() {
        if ((_fm.name.value = _fm.name.value.trim()).length == 0) {
            alert("請(qǐng)輸入姓名");
            _fm.name.focus();
            return false;
        }
        if ((_fm.name.value = _fm.name.value.trim()).length == 0) {
            alert("請(qǐng)輸入年齡");
            _fm.name.focus();
            return false;
        }
        if ((_fm.name.value = _fm.name.value.trim()).length == 0) {
            alert("請(qǐng)輸入監(jiān)護(hù)人");
            _fm.name.focus();
            return false;
        }
        if ((_fm.name.value = _fm.name.value.trim()).length == 0) {
            alert("請(qǐng)輸入地址");
            _fm.name.focus();
            return false;
        }
        if ((_fm.name.value = _fm.name.value.trim()).length == 0) {
            alert("請(qǐng)輸入聯(lián)系電話");
            _fm.name.focus();
            return false;
        }
        document.form.action = "/user/getAddApply.asp?s_id=" + <#QS:id> ;
        return true;
    }

    function excessive() {

    }

    /* 加載頁(yè)面*/
    function Loadpage() {
        /* PageSlide接收三個(gè)參數(shù):頁(yè)面元素,要設(shè)定的滑動(dòng)方向,可選的擴(kuò)展函數(shù)*/
        PageSlide = function (el, swipe, options) {
            this.options = options || {} //可選函數(shù)
            this.current = 0 //當(dāng)前頁(yè)面索引
            this.pageX //橫向的手指落點(diǎn)
            this.pageY //縱向的手指落點(diǎn)
            this.height //設(shè)備高度
            this.width //設(shè)備寬度
            this.flag //判斷滑動(dòng)方向的變量
            this.move //滑動(dòng)的距離
            this.$el = el //當(dāng)前頁(yè)面的對(duì)象
            this.swipe = swipe || 'X' //滑動(dòng)方向參數(shù)
            this.resize().init().bindEvents() //初始化
        }

        /*動(dòng)態(tài)設(shè)定translate3d參數(shù)方法*/
        PageSlide.prototype.setX = function (el, x, unit) {
            el && (el.style.webkitTransform = 'translate3d(' + x + (unit || 'px') + ',0,0)')
        }
        PageSlide.prototype.setY = function (el, y, unit) {
            el && (el.style.webkitTransform = 'translate3d(0,' + y + (unit || 'px') + ',0)')
        }

        /*頁(yè)面初始化時(shí)獲得當(dāng)前頁(yè)面的索引,并判斷當(dāng)前頁(yè)面是否存在*/
        PageSlide.prototype.init = function (i) {
            var current = i ? this.$el.children[i] : this.$el.firstElementChild
                //如果不存在該頁(yè)面,那么結(jié)束運(yùn)行
            if (!current) throw 'ERROR';
            //moving類(lèi)名作為當(dāng)前滑動(dòng)頁(yè)面的標(biāo)記,也在樣式中作滑動(dòng)的擴(kuò)展效果
            current.classList.add('moving')
                //設(shè)置頁(yè)面的動(dòng)畫(huà)
            current.style.webkitTransform = 'translate3d(0,0,0)'
                //以swipe的值預(yù)設(shè)置其他頁(yè)面的寬高,獲得流暢的交互效果
            for (var i = 1; i < this.$el.children.length; i++) {
                this['set' + this.swipe](this.$el.children[i], (this.swipe === 'X' ? this.width : this.height))
            }
            setTimeout(function () {
                current.classList.remove('moving')
                current.classList.add('play')
            }, 3e2)
            return this
        }

        /*為頁(yè)面綁定各種事件的綁定函數(shù)*/
        PageSlide.prototype.bindEvents = function () {
            var self = this
            window.addEventListener('resize orientationchange', this.resize.bind(this), false)
            'touchstart touchmove touchend touchcancel'.split(' ').forEach(function (evn) {
                //將四個(gè)觸控函數(shù)(申明在后面)綁定到每個(gè)頁(yè)面,并且傳遞該頁(yè)面對(duì)象
                self.$el.addEventListener(evn, self[evn].bind(self), false)
            })
        }

        /* 設(shè)置當(dāng)前觸控頁(yè)面translate3d參數(shù)為0的方法*/
        PageSlide.prototype.setCurrent = function (el, i) {
            //設(shè)置位移屬性
            el && (el.style.webkitTransform = 'translate3d(0,0,0)')
            if (i) {
                //得到頁(yè)面下標(biāo)
                this.current = i
                    //得到頁(yè)面對(duì)象
                this.$current = this.$el.children[i]
            }
        }

        /*獲得當(dāng)前觸控的頁(yè)面對(duì)象*/
        PageSlide.prototype.getCurrent = function () {
            return this.$el.children[this.current]
        }

        /*初始化時(shí)獲得設(shè)備的寬高*/
        PageSlide.prototype.resize = function () {
            this.width = this.$el.parentNode.clientWidth
            this.height = this.$el.parentNode.clientHeight
            return this
        }

        /*到達(dá)任意頁(yè)面的random()方法*/
        PageSlide.prototype.random = function () {
            //獲取所有頁(yè)面
            var count = this.$el.children.length
            var current = this.current
            var arr = []
            var num
            for (var i = 0; i < count; i++) {
                //將其他頁(yè)面的下標(biāo)存放在數(shù)組
                if (i !== current) arr.push(i.toString())
            }
            //隨機(jī)獲取頁(yè)面的下標(biāo)
            num = Math.floor(Math.random() * arr.length)
                //調(diào)用方法
            this.direct(+arr[num])
        }

        /* 四個(gè)內(nèi)建的滑動(dòng)事件函數(shù),與前面綁定函數(shù)相呼應(yīng)*/
        PageSlide.prototype.touchstart = function (e) {
            //獲取pages對(duì)象的touchers集合中的首個(gè)toucher對(duì)象,toucher觸摸對(duì)象
            var touches = e.touches[0]
                //觸控開(kāi)始
            this.flag = null
            this.move = 0
                //記錄落點(diǎn),獲取頁(yè)面的X和Y坐標(biāo)
            if (this.current !== 0) {
                //獲取中間有內(nèi)容的div的坐標(biāo)范圍
                var odiv = document.getElementsByClassName('center')[this.current - 1];
                //判斷觸點(diǎn)的坐標(biāo)是否在內(nèi)容div之內(nèi),如果在,則禁用touch事件
                if (touches.pageX>=odiv.getBoundingClientRect().left && touches.pageX<=odiv.getBoundingClientRect().right && touches.pageY>=odiv.getBoundingClientRect().top && touches.pageY<=odiv.getBoundingClientRect().bottom){
                     this.pageX=0;
                     this.pageY=0;
                }else{
                     this.pageX = touches.pageX
                     this.pageY = touches.pageY
                }
            }else{
                this.pageX = touches.pageX
                this.pageY = touches.pageY
            }
        }

        /* 滑動(dòng)觸發(fā)事件*/
        PageSlide.prototype.touchmove = function (e) {
            var touches = e.touches[0]
            if (this.current !== 0) {
                //獲取中間有內(nèi)容的div的坐標(biāo)范圍
                var odiv = document.getElementsByClassName('center')[this.current - 1];
                //判斷觸點(diǎn)的坐標(biāo)是否在內(nèi)容div之內(nèi),如果在,則禁用touch事件
                if (touches.pageX>=odiv.getBoundingClientRect().left && touches.pageX<=odiv.getBoundingClientRect().right && touches.pageY>=odiv.getBoundingClientRect().top && touches.pageY<=odiv.getBoundingClientRect().bottom){
                    //阻止默認(rèn)事件發(fā)生
                    e.preventDefault()
                        //阻止冒泡事件發(fā)生
                    e.stopPropagation()
                    e.nativeEvent.stopImmediatePropagation();
                    odiv.addEventListener('touchmove',function(e){e.returnValue = true;}, false);
                }else if(this.pageX===0&&this.pageY===0){
                    //阻止默認(rèn)事件發(fā)生
                    e.preventDefault()
                        //阻止冒泡事件發(fā)生
                    e.stopPropagation()
                    e.nativeEvent.stopImmediatePropagation();
                    odiv.addEventListener('touchmove',function(e){e.returnValue = true;}, false);
                } else {
                    //得到X和Y方向上的滑動(dòng)距離
                    var X = touches.pageX - this.pageX
                    var Y = touches.pageY - this.pageY
                        //得到當(dāng)前頁(yè)面對(duì)象
                    var current = this.getCurrent()
                        //獲取他的上一級(jí)和下一級(jí)頁(yè)面
                    var next = current.nextElementSibling
                    var prev = current.previousElementSibling
                        //添加移動(dòng)樣式
                    if (!this.flag) {
                        //判斷是橫向滑動(dòng)還是縱向滑動(dòng)
                        this.flag = Math.abs(X) > Math.abs(Y) ? 'X' : 'Y'
                        if (this.flag === this.swipe) {
                            //添加標(biāo)記
                            current.classList.add('moving')
                            next && next.classList.add('moving')
                            prev && prev.classList.add('moving')
                        }
                    }
                    //判斷滑動(dòng)變量和滑動(dòng)方向是否相等
                    if (this.flag === this.swipe) {
                        //阻止默認(rèn)事件發(fā)生
                        e.preventDefault()
                            //阻止冒泡事件發(fā)生
                        e.stopPropagation()
                        switch (this.swipe) {
                        case 'X':
                            //swipe horizontal
                            this.move = X
                            this.setX(current, X)
                                //調(diào)用set屬性
                            next && (this.setX(next, X + this.width))
                            prev && (this.setX(prev, X - this.width))
                            break;
                        case 'Y':
                            //swipe vertical
                            this.move = Y
                            this.setY(current, Y)
                                //調(diào)用set屬性
                            next && (this.setY(next, Y + this.height))
                            prev && (this.setY(prev, Y - this.height))
                            break;
                        }
                    }
                }
            } else {
                var touches = e.touches[0]
                    //得到X和Y方向上的滑動(dòng)距離
                var X = touches.pageX - this.pageX
                var Y = touches.pageY - this.pageY
                    //得到當(dāng)前頁(yè)面對(duì)象
                var current = this.getCurrent()
                    //獲取他的上一級(jí)和下一級(jí)頁(yè)面
                var next = current.nextElementSibling
                var prev = current.previousElementSibling
                    //添加移動(dòng)樣式
                if (!this.flag) {
                    //判斷是橫向滑動(dòng)還是縱向滑動(dòng)
                    this.flag = Math.abs(X) > Math.abs(Y) ? 'X' : 'Y'
                    if (this.flag === this.swipe) {
                        //添加標(biāo)記
                        current.classList.add('moving')
                        next && next.classList.add('moving')
                        prev && prev.classList.add('moving')
                    }
                }
                //判斷滑動(dòng)變量和滑動(dòng)方向是否相等
                if (this.flag === this.swipe) {
                    //阻止默認(rèn)事件發(fā)生
                    e.preventDefault()
                        //阻止冒泡事件發(fā)生
                    e.stopPropagation()
                    switch (this.swipe) {
                    case 'X':
                        //swipe horizontal
                        this.move = X
                        this.setX(current, X)
                            //調(diào)用set屬性
                        next && (this.setX(next, X + this.width))
                        prev && (this.setX(prev, X - this.width))
                        break;
                    case 'Y':
                        //swipe vertical
                        this.move = Y
                        this.setY(current, Y)
                            //調(diào)用set屬性
                        next && (this.setY(next, Y + this.height))
                        prev && (this.setY(prev, Y - this.height))
                        break;
                    }
                }
            }
        }

        /* 滑動(dòng)結(jié)束觸發(fā)事件*/
        PageSlide.prototype.touchend = function (e) {
            //設(shè)置最小滑動(dòng)距離
            var minRange = 50
            var move = this.move
                //獲取當(dāng)前頁(yè)面對(duì)象
            var current = this.getCurrent()
                //獲取上下頁(yè)面對(duì)象
            var next = current.nextElementSibling
            var prev = current.previousElementSibling
                //給他們移除標(biāo)記
            current.classList.remove('moving')
            next && next.classList.remove('moving')
            prev && prev.classList.remove('moving')
            if (!this.flag) return
                //調(diào)用默認(rèn)方法
            e.preventDefault()
                //滑動(dòng)結(jié)束前往下一頁(yè)面,next()方法調(diào)用了go()方法,判斷是去上一頁(yè)還是去下一頁(yè)
            if (move < -minRange && next) return this.next()
            if (move > minRange && prev) return this.prev()
                //調(diào)用重置方法
            this.reset()
        }

        /* 滑動(dòng)之后跟蹤事件*/
        PageSlide.prototype.touchcancel = function (e) {
            //獲取當(dāng)前頁(yè)面和上下級(jí)頁(yè)面對(duì)象
            var current = this.getCurrent()
            var next = current.nextElementSibling
            var prev = current.previousElementSibling
                //移除標(biāo)記
            current.classList.remove('moving')
            next && next.classList.remove('moving')
            prev && prev.classList.remove('moving')
                //調(diào)用重置方法
            this.reset()
        }

        /* 調(diào)用go()方法前往下一頁(yè)或上一頁(yè)面*/
        PageSlide.prototype.next = function () {
            this.go(this.current + 1)
        }
        PageSlide.prototype.prev = function () {
            this.go(this.current - 1)
        }

        /* 重置方法,用于初始化以及當(dāng)前頁(yè)面的重置*/
        PageSlide.prototype.reset = function () {
            var width = this.width
            var height = this.height
            var swipe = this.swipe
            var current = this.getCurrent()
            var prev = current.previousElementSibling
            var next = current.nextElementSibling
            this.setCurrent(current)
            prev && (this['set' + swipe](prev, -(swipe === 'X' ? width : height)))
            next && (this['set' + swipe](next, swipe === 'X' ? width : height))
        }

        /* 去往下一或上一頁(yè)面的go方法*/
        PageSlide.prototype.go = function (i) {
            var onFinish = this.options.onFinish
            var current = this.getCurrent()
                //獲取最后一頁(yè)
            var total = this.$el.childElementCount
            var target = this.$el.children[i]
            var d = i < this.current ? -1 : 1
            if (i === this.current || i < 0 || i >= total) return
            if (onFinish && (typeof onFinish === 'function')) onFinish.call(this, i)
                // 滑動(dòng)完成調(diào)用方法
            typeof this.options.tranSetionEnd === 'function' && this.options.tranSetionEnd.call(this)
            this.current = i
            this['set' + this.swipe](current, -d * (this.swipe === 'X' ? this.width : this.height))
            this.setCurrent(target, i)
            this.finish(current, target)
        }

        /* 滑動(dòng)完成后刪除當(dāng)前頁(yè)面.play標(biāo)記以及為下一頁(yè)面添加.play標(biāo)記*/
        PageSlide.prototype.finish = function (curr, target) {
            this.flag = null
            setTimeout(function () {
                curr && curr.classList.remove('play')
                target && target.classList.add('play')
            }, 3e2)
        }

        PageSlide.prototype.direct = function (i) {
            if (i && typeof (i) === 'number') {
                this.go(i)
                for (var j = 0; j < i; j++) {
                    this['set' + this.swipe](this.$el.children[j], -1 * (this.swipe === 'X' ? this.width : this.height))
                }
            } else return
        }

        // 傳參 
        document.addEventListener('touchmove', function (e) {
            e.preventDefault()
        })

        /* 實(shí)例化顯現(xiàn)頁(yè)面*/
        var pages = new PageSlide(document.querySelector('.pages'), 'Y', {
            tranSetionEnd: function () {
                console.log(this.current);
            }
        })
    }
</script>
<style>
    html,
    body {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        overflow: hidden;
        font-family: "Arial", "Microsoft YaHei", "黑體", "宋體", sans-serif;
    }
    .pages {
        width: 100%;
        height: 100%;
        position: relative;
        background: #FFF;
    }
    .page {
        font-size: 22px;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        transform: translate3d(0px, 100%, 0px);
        -webkit-transform: translate3d(0px, 100%, 0px);
        -moz-transform: translate3d(0px, 100%, 0px);
        transition: transform .5s ease-out;
        -webkit-transition: -webkit-transform .5s ease-out;
        -moz-transition: -moz-transform .5s ease-out;
        background-image: url(<#PATH>招生.png);
        background-repeat: no-repeat;
        background-size: 100% 100%;
    }
    @-webkit-keyframes move {
        100% {
            -webkit-transform: translate3d(150px, 0, 0);
            transform: translate3d(150px, 0, 0);
            -ms-transform: translate3d(150px, 0, 0);
        }
    }
    /*旋轉(zhuǎn)*/
    .rotate {
        width: 50px;
        height: 50px;
        border-radius: 25px;
        position: fixed;
        background-image: url(<#PATH>音樂(lè).png);
        background-repeat: no-repeat;
        background-size: 100% 100%;
        top: 15;
        left: 8;
        display: inline-block;
        -webkit-animation: rotate 5s linear;
        animation: rotate 5s linear;
        animation-iteration-count: 999999;//定義動(dòng)畫(huà)播放的次數(shù)
        -webkit-animation-iteration-count: 999999;
    }
    @-webkit-keyframes rotate {
        0% {
            -webkit-transform: rotate(0deg);
            transform: rotate(0deg)
        }
        100% {
            -webkit-transform: rotate(359deg);
            transform: rotate(359deg)
        }
    }
    .xiangxiatishi {
        position: fixed;
        bottom: 20px;
        left: 50%;
        -webkit-transform: translateX(-50%);
        -webkit-animation: dong 1s linear 0s infinite alternate;
    }
    .top {
        width: 70%;
        height: 25%;
        margin: 0 auto;
        background-color: rgba(0, 0, 0, 0);
        text-align: center;
    }
    .center {
        width: 80%;
        height: 35%;
        margin: 0 auto;
        background-color: #FFF;
        border-radius: 15px;
        overflow-y:scroll;
    }
</style>

</head>

<body>

<audio src='include/小星星.mp3' autoplay="autoplay" loop="true" id=emb></audio>
<div class="pages">
    <div class="page page1">
        <div id=btnMusic alt="停止音樂(lè)" class="rotate" onclick=changeMusic()></div>
        <!-- <a onclick=changeMusic()><img src="<#PATH>音樂(lè).png" id=btnMusic alt="停止音樂(lè)" class="btnMusic" ></a> -->
        <div style="margin-top:20%;margin-left:8%;width:60%;height:55%;background:url(<#PATH>yuncai.png);background-repeat: no-repeat;background-size: 100% 100%;">
            <table style=";width:100%;height:95%;text-align:center;font-size:24px;color:#58B8FE;">
                <tr>
                    <td>
                        <div onclick="" style="padding-top:5%;">學(xué)園簡(jiǎn)介</div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div onclick="">校園風(fēng)采</div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div onclick="">教師風(fēng)采</div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div onclick="">招生信息</div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="page page2">
        <div class=top>
            <h2 style="padding-top:50px;">學(xué)園簡(jiǎn)介</h2>
        </div>
        <div class=center>
            <table width="90%">
                <tr>
                    <td id=park colspan=2></td>
                </tr>
                <tr>
                    <td id=about colspan=2></td>
                </tr>
                <tr>
                    <td colspan=2>
                        <img style="width:100%;" class=s_picture />
                    </td>
                </tr>
                <tr>
                    <td>地址:</td>
                    <td id=address></td>
                </tr>
                <tr>
                    <td>聯(lián)系人:</td>
                    <td class=contacts></td>
                </tr>
                <tr>
                    <td>聯(lián)系電話:</td>
                    <td class=phone></td>
                </tr>
            </table>
        </div>
    </div>
    <div class="page page3">
        <div class=top>
            <h2 style="padding-top:50px;">校園風(fēng)采</h2>
        </div>
        <div class=center>
            <table width="90%">
                <tr>
                    <td>
                        <h4>辦學(xué)宗旨</h4>
                    </td>
                </tr>
                <tr>
                    <td id=purpose></td>
                </tr>
                <tr>
                    <td>
                        <h4>辦學(xué)目標(biāo)</h4>
                    </td>
                </tr>
                <tr>
                    <td id=target></td>
                </tr>
                <tr>
                    <td>
                        <img style="width:100%;" class=s_picture />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="page page4">
        <div class=top>
            <h2 style="padding-top:50px;">教師風(fēng)采</h2>
        </div>
        <div class=center>
            <img style="width:100%;" class=s_picture />
        </div>
    </div>
    <div class="page page5">
        <div class=top>
            <h2 style="padding-top:50px;">招生信息</h2>
        </div>
        <div class=center>
            <table>
                <tr>
                    <td id=slogan colspan=2></td>
                </tr>
                <tr>
                    <td>招生對(duì)象:</td>
                    <td id=object></td>
                </tr>
                <tr>
                    <td>報(bào)名時(shí)間:</td>
                    <td id=time></td>
                </tr>
                <tr>
                    <td>招生班級(jí):</td>
                    <td id=enrolment_class></td>
                </tr>
                <tr>
                    <td>辦學(xué)承諾:</td>
                    <td id=promise></td>
                </tr>
                <tr>
                    <td>報(bào)名費(fèi)用:</td>
                    <td id=charges></td>
                </tr>
                <tr>
                    <td>聯(lián)系人:</td>
                    <td class=contacts></td>
                </tr>
                <tr>
                    <td>聯(lián)系電話:</td>
                    <td class=phone></td>
                </tr>
                <tr>
                    <td colspan=2>
                        <img style="height:100%;" id=pictures />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="page page5">
        <div class=top>
            <h2 style="padding-top:50px;">報(bào)名信息</h2>
        </div>
        <div class=center>
            <form method=post name=form onsubmit="try{return sbmChk();}catch(e){alert(e.description);return false;}" ajaxdone="if($.ajax.callback()){alert('報(bào)名成功!');}">
                <table>
                    <tr>
                        <td>姓名:</td>
                        <td>
                            <input name=name>
                        </td>
                    </tr>
                    <tr>
                        <td>年齡:</td>
                        <td>
                            <input name=name>
                        </td>
                    </tr>
                    <tr>
                        <td>監(jiān)護(hù)人:</td>
                        <td>
                            <input name=guardian placeholder="填一個(gè)監(jiān)護(hù)人即可">
                        </td>
                    </tr>
                    <tr>
                        <td>地址:</td>
                        <td>
                            <input name=address>
                        </td>
                    </tr>
                    <tr>
                        <td>聯(lián)系電話:</td>
                        <td>
                            <input name=phone placeholder="填一個(gè)手機(jī)號(hào)即可">
                        </td>
                    </tr>
                    <tr>
                        <td colspan=2>
                            <input type=submit value=立即報(bào)名>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
<div class=xiangxiatishi>向下提示</div>

</body>

</html>圖片描述

回答
編輯回答
貓小柒

e.nativeEvent.stopImmediatePropagation();方法是防止對(duì)事件流中當(dāng)前節(jié)點(diǎn)中和所有后續(xù)節(jié)點(diǎn)中的事件偵聽(tīng)器進(jìn)行處理。此方法會(huì)立即生效,并且會(huì)影響當(dāng)前節(jié)點(diǎn)中的事件偵聽(tīng)器。而這里只需要對(duì)當(dāng)前事件偵聽(tīng)器進(jìn)行處理,所以這里不需要,注釋掉即可,還有綁定需要滾動(dòng)的那個(gè)div的對(duì)象,綁定個(gè)touchmove事件中e.stopPropagation()防止冒泡即可。

2018年1月26日 21:32