Skip to content

Instantly share code, notes, and snippets.

@kanreisa
Created October 9, 2010 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanreisa/618548 to your computer and use it in GitHub Desktop.
Save kanreisa/618548 to your computer and use it in GitHub Desktop.
{
// スライドモーション検出
document.observe('touchmove',function(e){
//e.preventDefault(); //スクロール禁止
stat.touchmoveFlag = true;
});
// リスト挙動
var target = $$('li.status');
for(var i = 0; i < target.length; i++){
target[i].observe('touchstart', function(){
// :hover代替
this.addClassName('status_hover');
stat.touchmoveFlag = false;
});
target[i].observe('touchend',function(){
// :hover代替
this.removeClassName('status_hover');
if(stat.touchmoveFlag==false){
if(stat.selected){
stat.selected.removeClassName('status_selected');
}
// 選択
this.addClassName('status_selected');
stat.selected = this;
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment