我寫(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()防止冒泡即可。
北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專(zhuān)業(yè)的國(guó)家
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
北大課工場(chǎng)是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國(guó)家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國(guó)制造2025”,實(shí)現(xiàn)中華民族偉大復(fù)興的升級(jí)產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國(guó)職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開(kāi)發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_(kāi)發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開(kāi)發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開(kāi)發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開(kāi)發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問(wèn),美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。