diff options
author | Florian Merz <me@fiji-flo.de> | 2021-02-11 13:12:08 +0100 |
---|---|---|
committer | Florian Merz <me@fiji-flo.de> | 2021-02-11 13:12:08 +0100 |
commit | 43a5cac2eff22c21071800e13bef12af9d3a37d0 (patch) | |
tree | f6e91f8aa958f15bd0b0aabf7b8dfc09063eceda /files/zh-tw/orphaned/html5_cross_browser_polyfills/index.html | |
parent | 8260a606c143e6b55a467edf017a56bdcd6cba7e (diff) | |
download | translated-content-43a5cac2eff22c21071800e13bef12af9d3a37d0.tar.gz translated-content-43a5cac2eff22c21071800e13bef12af9d3a37d0.tar.bz2 translated-content-43a5cac2eff22c21071800e13bef12af9d3a37d0.zip |
unslug zh-tw: move
Diffstat (limited to 'files/zh-tw/orphaned/html5_cross_browser_polyfills/index.html')
-rw-r--r-- | files/zh-tw/orphaned/html5_cross_browser_polyfills/index.html | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/files/zh-tw/orphaned/html5_cross_browser_polyfills/index.html b/files/zh-tw/orphaned/html5_cross_browser_polyfills/index.html new file mode 100644 index 0000000000..d823a44760 --- /dev/null +++ b/files/zh-tw/orphaned/html5_cross_browser_polyfills/index.html @@ -0,0 +1,34 @@ +--- +title: HTML5 跨瀏覽器兼容程式碼 +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 && 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> |