Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Internet Explorer 10: 重新想像網站設計

Internet Explorer 10: 重新想像網站設計

本投影片介紹如何針對 Internet Explorer 10 的新特性,以及支援的多樣平台上,重新想像網頁設計的細節。

範例程式碼在 http://github.com/ericsk/ie10-samples

Eric Shangkuan

January 15, 2013
Tweet

More Decks by Eric Shangkuan

Other Decks in Programming

Transcript

  1. @media (max-width: 480px) { body { padding-top: 70px; } }

    @media (max-width: 768px) { body { padding-top: 0; } } 根據不同的解析度套用不同的樣式
  2. Value Description auto Default value for -ms-touch-action. Browser determines. none

    No default behavior is allowed. manipulation Only panning, pinch zoom, and swiping to navigate forward or back are allowed. double-tap-zoom Only double-tap zooming is allowed. inherit The element inherits the value of -ms-touch-action from its parent. -ms-touch-action: auto | none | manipulation | double-tap-zoom | inherit; 利用觸控方式捲動和縮放: http://msdn.microsoft.com/zh-TW/library/ie/hh920761.aspx
  3. Pointer Event event.pointerType var el = document.getElementById('drawface'); // 判斷是否支援 pointer

    event if (navigator.msPointerEnabled) { el.addEventListener('MSPointerDown', handleTouchInput, false); } else { // fallback el.addEventListener('mousedown', handleTouchInput, false); } 參考: http://blogs.msdn.com/b/ie/archive/2011/09/20/touch-input-for-ie10-and-metro-style-apps.aspx
  4. Gesture event var el = document.getElementById('drawface'); var gesture = new

    MSGesture(); // 加入 pointer el.addEventListener('MSPointerDown', function (evt) { gesture.addPointer(evt.pointerId); }, false); // Tap and Hold el.addEventListener('MSGestureTap', handleTap, false); el.addEventListener('MSGestureHold', handleHold, false); // dynamic gesture // 讀取 evt.scale, evt.rotate, evt.translationX, evt.translationY, // evt.velocityAngular, evt.velocityExpansion, evt.velocityX, evt.velocityY el.addEventListener('MSGestureChange', handleGesture, false); 參考: http://blogs.msdn.com/b/ie/archive/2012/06/20/go-beyond-pan-zoom-and-tap-using-gesture-events.aspx
  5. Windows 8 子母畫面 (Snapped view) @media screen and (max-width: 400px)

    { @-ms-viewport { width: 320px; } /* 當 Modern IE10 在貼齊模式時的樣式設定,並且將 可視區域設為 320px */ } Full Snap