溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

jquery全屏模式插件

發(fā)布時間:2020-10-13 21:12:05 來源:網(wǎng)絡(luò) 閱讀:5937 作者:magicsa 欄目:web開發(fā)

項目地址:https://github.com/martinaglv/jQuery-FullScreen


How to use

Include jquery.fullscreen.js in your page along with version 1.7 of the jQuery library. This gives you the$('#elem').fullScreen() method. You can optionally pass an object with properties:

PropertyValueMeaning
backgrounda color hashThis is the color that will be used for the background.
callbacka functionThe callback function will be called on a full screen change event. It has one argument - a boolean indicating whether we are in full screen or not.
fullscreenClassa stringThis is the CSS class that will be added to elements in fullscreen mode. The default class is "fullScreen".

After the plugin makes your element full screen, it will add the fullScreen class on it (unless overridden with the fullscreenClass parameter), so you can easily style it.

Example

// 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//      // ...//  }// });});}

You can then apply additional styles to your element. Take the opportunity to increase the font size, hide distractions and make for a better reading experience.

#content.fullScreen{/* Give the element a width and margin:0 auto; to center it. */}

If you later wish to cancel the full screen view, you can do so by calling the fullScreen() method again.


附件:http://down.51cto.com/data/2363379
向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI