html5移動開發知識點大全

2022-03-06 14:59:09 字數 1862 閱讀 8745

//橫屏時使用的樣式

// 手勢事件

touchstart            //當手指接觸螢幕時觸發

touchmove           //當已經接觸螢幕的手指開始移動後觸發

touchend             //當手指離開螢幕時觸發

touchcancel

// 觸控事件

gesturestart          //當兩個手指接觸螢幕時觸發

gesturechange      //當兩個手指接觸螢幕後開始移動時觸發

gestureend

// 螢幕旋轉事件  

onorientationchange    

// 檢測觸控螢幕的手指何時改變方向      

orientationchange      

// touch事件支援的相關屬性

touches        

targettouches      

changedtouches             

clientx    // x coordinate of touch relative to the viewport (excludes scroll offset)      

clienty    // y coordinate of touch relative to the viewport (excludes scroll offset)      

screenx    // relative to the screen       

screeny     // relative to the screen      

pagex     // relative to the full page (includes scrolling)    

pagey     // relative to the full page (includes scrolling)    

target     // node the touch event originated from     

identifier     // an identifying number, unique to each touch event

4. 螢幕旋轉事件:onorientationchange

新增螢幕旋轉事件偵聽,可隨時發現螢幕旋轉狀態(左旋、右旋還是沒旋)。例子:

// 判斷螢幕是否旋轉

function orientationchange() ;

};// 新增事件監聽

addeventlistener('load', function());

5. 隱藏位址列 & 處理事件的時候,防止滾動條出現:

// 隱藏位址列  & 處理事件的時候 ,防止滾動條出現

addeventlistener('load', function(), 100);

});6. 雙手指滑動事件:

// 雙手指滑動事件

addeventlistener('load',  function(),

false              // 相容各瀏覽器,表示在冒泡階段呼叫事件處理程式 (true 捕獲階段)

);function twofingerscroll(ev) ;

7. 判斷是否為iphone:

如果你關閉自動識別後 ,又希望某些**號碼能夠鏈結到 iphone 的撥號功能 ,那麼可以通過這樣來宣告**鏈結 ,

打**給我

發簡訊或用於單元格:

10. 自動大寫與自動修正

html5標籤屬性大全 HTML5知識點總結

html5新增的內容性標籤 標籤 用於定義頁首資訊。2.標籤 定義導航欄。6.基本步驟 1.canvas標籤的定義 2.使用js獲取該canvas物件 var3.獲取2d圖形上下文物件 var4.使用context物件的屬性方法進行繪製 context基本使用方法 通過拖放api可以使頁面中任意元素...

html5移動端知識點總結

1.1使用 查詢,不同解析度設定不同的html的font size min width 320px min width 360px min width 400px min width 640px 優點 使用css即可實現,不需要js 缺點 只能匹配部分機型 1.2使用js 控制html的font s...

html5移動端製作知識點總結

固屏類流體設計 1.京東 2.網 全屏 固屏,導航一般用全屏 四 標籤,放在之間 name viewport 視窗設定 width device width 頁面大小螢幕等寬 initial scale 1.0 初始縮放比例,1.0 表示原始比例大小 minimum scale 1.0 允許縮放的最...