顯示具有 Javascript 標籤的文章。 顯示所有文章
顯示具有 Javascript 標籤的文章。 顯示所有文章

2011年5月10日 星期二

iOS Load Local Javascript

https://devforums.apple.com/message/32282#32282

如果要在iOS中讀取local的javascript檔案,需將javascript丟到project內。
再到Project設定中-> Build Phases中
  1. 選擇第三個 Compile Sources按「-」把該js刪掉
  2. 選擇第二個 Copy Bundle Resources 按「+」將該js加進來

HTML on Touch Device


var supportTouch = "ontouchend" in document,
touchStartEvent = supportTouch ? "touchstart" : "mousedown",
touchMoveEvent = supportTouch ? "touchmove" : "mousemove",
touchStopEvent = supportTouch ? "touchend" : "mouseup";

//以上為偵測裝置是否有支援touch,有則用touch沒有則用mouse。

$touchpad.bind(touchStartEvent, function(e) {
//Your Code Here
});
$touchpad.bind(touchMoveEvent, function(e) {
//Your Code Here
});
$touchpad.bind(touchStopEvent, function(e) {
//Your Code Here
});



Touch In This Area!