aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/orphaned/html5_cross_browser_polyfills/index.html
blob: fdb15238ed1a0dce6baad7bcef7d420cecb5c6c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
title: HTML5 跨瀏覽器兼容程式碼
slug: orphaned/HTML5_Cross_Browser_Polyfills
original_slug: HTML5_Cross_Browser_Polyfills
---
<p>這是個蒐集中文世界開發(但不一定原創)的跨瀏覽器兼容代碼、連結的地方,作為 Paul Irish<a class=" link-https" href="https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills" title="https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills">《HTML5 Cross Browser Polyfills》</a>的仿效文件。蒐集不會完全,因此也強烈建議繼續追蹤上述文件的進展,或是使用搜尋引擎。</p>
<p>歡迎貢獻新的代碼、連結,不過請注意放在這個地方的代碼皆屬於<a class=" external" href="http://zh.wikipedia.org/wiki/%E5%85%AC%E6%9C%89%E9%A0%98%E5%9F%9F" title="http://zh.wikipedia.org/wiki/公有領域">公有領域</a></p>
<h2 id="全頻(fullscreen)API">全頻(fullscreen)API</h2>
<p>支援  Gecko:FullScreenAPI 草案的 {{ domxref("window.fullScreen") }}{{ domxref("element.onfullscreenchange", "fullscreenchange") }} 事件 ,由<a class=" external" href="http://hax.iteye.com/" title="http://hax.iteye.com/">贺师俊</a>(hax)所<a class=" external" href="http://lists.w3.org/Archives/Public/public-html-ig-zh/2011Aug/0005" title="http://lists.w3.org/Archives/Public/public-html-ig-zh/2011Aug/0005">提供</a></p>
<pre class="brush: js">if (!('fullScreen' in window)) Object.defineProperty(window, 'fullScreen', {
  get: function() {
  return (screen.width == window.outerWidth &amp;&amp; screen.height == window.outerHeight)
  }
})

var _fullScreen = window.fullScreen
if (!('onfullscreenchange' in window)) window.addEventListener('resize', function() {
  var f = window.fullScreen
  if (f != _fullScreen) {
    _fullScreen = f
    fireSimpleEvent('fullscreenchange', document, {bubbles:true})
  }
}, false)

function fireSimpleEvent(type, target, option) {
  if (!target) target = document
  if (!option) option = {}
  var evt = document.createEvent('Event')
  evt.initEvent(type, !!option.bubbles, !!option.cancelable)
  return target.dispatchEvent(evt)
}
</pre>
<h2 id="中文排版">中文排版</h2>
<ul> <li><a class=" external" href="http://ethantw.net/projects/han/" title="http://ethantw.net/projects/han/">漢字標準格式・CSS Reset</a>(Ethan) <ul> <li>{{ HTMLElement("ruby") }}(上測、右側)、用 {{ HTMLElement("em") }} 達到著重號的效果(CSS 屬性 {{ cssxref("text-emphasis") }}),非 CSS 模擬。</li> </ul> </li>
</ul>