/**
* 通过jquery $(".touch").bind({}) 给所有需要监听的标签添加监听事件
* 触摸变换背景高亮显示 会随着触摸事件的三种状态执行不同的操作
*/
//触摸要修改的css类
var touchClass = new RegExp('(^|\\s)changebg_iscroll(\\s|$)');
function touch_change(){
$(".touch").bind({
"touchstart" : function(){ this.className = this.className ? this.className + " changebg_iscroll" : "changebg_iscroll"; }, //触摸发生时
"touchmove" : function(){ if(touchClass.test(this.className)){ this.className = this.className.replace(touchClass, '');} }, //触摸移动时
"touchend" : function(){ if(touchClass.test(this.className)){ this.className = this.className.replace(touchClass, ''); } } //触摸结束时
});
}