国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

html5頁(yè)面在手機(jī)上手指左右滑動(dòng)_html/css_WEB-ITnose

php中文網(wǎng)
發(fā)布: 2016-06-24 12:03:00
原創(chuàng)
1680人瀏覽過(guò)

html5在手機(jī)上手指左右滑動(dòng)切換頁(yè)面,哪位大蝦做過(guò),給個(gè)列子?
例如:http://imag.jimi.com/dx/


回復(fù)討論(解決方案)

這個(gè)有何難啊,使用?touchwipe.js?很簡(jiǎn)單的就能實(shí)現(xiàn)了

你發(fā)的另外一個(gè)貼子我回復(fù)了。

這個(gè)有何難啊,使用?touchwipe.js?很簡(jiǎn)單的就能實(shí)現(xiàn)了

能給個(gè)列子不?


這個(gè)有何難啊,使用?touchwipe.js?很簡(jiǎn)單的就能實(shí)現(xiàn)了

能給個(gè)列子不?
<script>jq1.9min.js</script><script>(function(a){	a.fn.touchwipe=function(c){		var b={			drag:false,			min_move_x:20,			min_move_y:20,			wipeLeft:function(){/*向左滑動(dòng)*/},			wipeRight:function(){/*向右滑動(dòng)*/},			wipeUp:function(){/*向上滑動(dòng)*/},			wipeDown:function(){/*向下滑動(dòng)*/},			wipe:function(){/*點(diǎn)擊*/},			wipehold:function(){/*觸摸保持*/},			wipeDrag:function(x,y){/*拖動(dòng)*/},			preventDefaultEvents:true		};		if(c){a.extend(b,c)};		this.each(function(){			var h,g,j=false,i=false,e;			var supportTouch = "ontouchstart" in document.documentElement;			var moveEvent = supportTouch ? "touchmove" : "mousemove",			startEvent = supportTouch ? "touchstart" : "mousedown",			endEvent = supportTouch ? "touchend" : "mouseup"									/* 移除 touchmove 監(jiān)聽(tīng) */			function m(){				this.removeEventListener(moveEvent,d);				h=null;				j=false;				clearTimeout(e)			};						/* 事件處理方法 */			function d(q){				if(b.preventDefaultEvents){					q.preventDefault()				};				if(j){					var n = supportTouch ? q.touches[0].pageX : q.pageX;					var r = supportTouch ? q.touches[0].pageY : q.pageY;					var p = h-n;					var o = g-r;					if(b.drag){						h = n;						g = r;						clearTimeout(e);						b.wipeDrag(p,o);					}					else{						if(Math.abs(p)>=b.min_move_x){							m();							if(p>0){b.wipeLeft()}							else{b.wipeRight()}						}						else{							if(Math.abs(o)>=b.min_move_y){								m();								if(o>0){b.wipeUp()}								else{b.wipeDown()}							}						}					}				}			};						/*wipe 處理方法*/			function k(){clearTimeout(e);if(!i&&j){b.wipe()};i=false;j=false;};			/*wipehold 處理方法*/			function l(){i=true;b.wipehold()};						function f(n){				//if(n.touches.length==1){					h = supportTouch ? n.touches[0].pageX : n.pageX;					g = supportTouch ? n.touches[0].pageY : n.pageY;					j=true;					this.addEventListener(moveEvent,d,false);					e=setTimeout(l,750)				//}			};						//if("ontouchstart"in document.documentElement){				this.addEventListener(startEvent,f,false);				this.addEventListener(endEvent,k,false)			//}		});		return this	};})(jQuery);/*     調(diào)用*/$("#aa").touchwipe({			wipeLeft:function(){ alert("向左滑動(dòng)了")},			wipeRight:function(){alert("向右滑動(dòng)了")},})</script><div id="aa">    abcde </div>
登錄后復(fù)制
登錄后復(fù)制



這個(gè)有何難啊,使用?touchwipe.js?很簡(jiǎn)單的就能實(shí)現(xiàn)了

能給個(gè)列子不?
<script>jq1.9min.js</script><script>(function(a){	a.fn.touchwipe=function(c){		var b={			drag:false,			min_move_x:20,			min_move_y:20,			wipeLeft:function(){/*向左滑動(dòng)*/},			wipeRight:function(){/*向右滑動(dòng)*/},			wipeUp:function(){/*向上滑動(dòng)*/},			wipeDown:function(){/*向下滑動(dòng)*/},			wipe:function(){/*點(diǎn)擊*/},			wipehold:function(){/*觸摸保持*/},			wipeDrag:function(x,y){/*拖動(dòng)*/},			preventDefaultEvents:true		};		if(c){a.extend(b,c)};		this.each(function(){			var h,g,j=false,i=false,e;			var supportTouch = "ontouchstart" in document.documentElement;			var moveEvent = supportTouch ? "touchmove" : "mousemove",			startEvent = supportTouch ? "touchstart" : "mousedown",			endEvent = supportTouch ? "touchend" : "mouseup"									/* 移除 touchmove 監(jiān)聽(tīng) */			function m(){				this.removeEventListener(moveEvent,d);				h=null;				j=false;				clearTimeout(e)			};						/* 事件處理方法 */			function d(q){				if(b.preventDefaultEvents){					q.preventDefault()				};				if(j){					var n = supportTouch ? q.touches[0].pageX : q.pageX;					var r = supportTouch ? q.touches[0].pageY : q.pageY;					var p = h-n;					var o = g-r;					if(b.drag){						h = n;						g = r;						clearTimeout(e);						b.wipeDrag(p,o);					}					else{						if(Math.abs(p)>=b.min_move_x){							m();							if(p>0){b.wipeLeft()}							else{b.wipeRight()}						}						else{							if(Math.abs(o)>=b.min_move_y){								m();								if(o>0){b.wipeUp()}								else{b.wipeDown()}							}						}					}				}			};						/*wipe 處理方法*/			function k(){clearTimeout(e);if(!i&&j){b.wipe()};i=false;j=false;};			/*wipehold 處理方法*/			function l(){i=true;b.wipehold()};						function f(n){				//if(n.touches.length==1){					h = supportTouch ? n.touches[0].pageX : n.pageX;					g = supportTouch ? n.touches[0].pageY : n.pageY;					j=true;					this.addEventListener(moveEvent,d,false);					e=setTimeout(l,750)				//}			};						//if("ontouchstart"in document.documentElement){				this.addEventListener(startEvent,f,false);				this.addEventListener(endEvent,k,false)			//}		});		return this	};})(jQuery);/*     調(diào)用*/$("#aa").touchwipe({			wipeLeft:function(){ alert("向左滑動(dòng)了")},			wipeRight:function(){alert("向右滑動(dòng)了")},})</script><div id="aa">    abcde </div>
登錄后復(fù)制
登錄后復(fù)制
在手機(jī)上怎么沒(méi)效果???

jq1.9min.js這個(gè)文件在哪下載

HTML速學(xué)教程(入門(mén)課程)
HTML速學(xué)教程(入門(mén)課程)

HTML怎么學(xué)習(xí)?HTML怎么入門(mén)?HTML在哪學(xué)?HTML怎么學(xué)才快?不用擔(dān)心,這里為大家提供了HTML速學(xué)教程(入門(mén)課程),有需要的小伙伴保存下載就能學(xué)習(xí)啦!

下載
來(lái)源:php中文網(wǎng)
本文內(nèi)容由網(wǎng)友自發(fā)貢獻(xiàn),版權(quán)歸原作者所有,本站不承擔(dān)相應(yīng)法律責(zé)任。如您發(fā)現(xiàn)有涉嫌抄襲侵權(quán)的內(nèi)容,請(qǐng)聯(lián)系admin@php.cn
最新問(wèn)題
開(kāi)源免費(fèi)商場(chǎng)系統(tǒng)廣告
最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板
關(guān)于我們 免責(zé)申明 意見(jiàn)反饋 講師合作 廣告合作 最新更新
php中文網(wǎng):公益在線php培訓(xùn),幫助PHP學(xué)習(xí)者快速成長(zhǎng)!
關(guān)注服務(wù)號(hào) 技術(shù)交流群
PHP中文網(wǎng)訂閱號(hào)
每天精選資源文章推送
PHP中文網(wǎng)APP
隨時(shí)隨地碎片化學(xué)習(xí)
PHP中文網(wǎng)抖音號(hào)
發(fā)現(xiàn)有趣的

Copyright 2014-2025 http://m.miracleart.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號(hào)