實現網頁的全屏顯示jQuery插件:jQuery FullScreen Plugin
這是一個對 Full Screen API 的封裝 jQuery 插件,實現網頁的全屏顯示。適用各種不同的瀏覽器,包括FF 10, Chrome 和 Safari。它用于為用戶提供了一個更容易閱讀的網頁版本,可縮放<canvas>和<video>元素。
示例代碼:
// The plugin sets the $.support.fullscreen flag:
if($.support.fullscreen){
// ...
// Show your full screen button here
// ...
$('#fullScreen').click(function(e){
$('#content').fullScreen();
// You can also pass a hash with properties:
// $('#content').fullScreen({
// 'background' : '#111',
// 'callback' : function(isFullScreen){
// // ...
// // Do some cleaning up here
// // ...
// }
// });
});
}
示例
Go to Tutorialzine for a live demo.
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!