---
title: "jquery mobile"
author: "wenjinglian"
date: "2013-03-15T20:07:53Z"
tags: ["Mobile", "jQuery"]
categories: ["Web前端"]
slug: "jquery-mobile"
draft: false
lastmod: "2013-03-15T20:11:32Z"
id: 1830262
url: "https://nassir.iteye.com/blog/1830262"
---

jquery mobile 中文网：[http://www.jqmapi.com/index.html](http://www.jqmapi.com/index.html)

 

mobile 相关事件学习：[http://pkw.iteye.com/blog/1207418](http://pkw.iteye.com/blog/1207418)

 

```
//滑动,在电脑上可以按住右键模拟左右滑动
$(".wrap").bind("swiperight", function(){
	//像右滑动		
		}).bind("swipeleft", function(){
			//像右滑动
		});
```

 

 

```
//回顶部 
$(".backTop").bind("tap",function(){ //tap 触摸事件，在电脑上相当click事件
  $.mobile.silentScroll(0); //滚动到Y轴为0位置
});
```

 

 jquery选项卡简单代码：

 

```
<div class="tab">
<a>tab1</a>
<a>tab2></a>
<div>
<div id="tab0"></div>
<div id="tab1"></div>

$(".tab a").click(function(){
	     $(this).addClass("selected").siblings().removeClass("selected");
		$("#tab" + $(this).index()).show().siblings().hide();
	});
```