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ypH0LCDhMusTKlkZDMnANDu2+PsgIOGK0GM8r4JB0lpN3ZLgCyyCPKiAsmk0y+McyPKaGHioeRsr2LR1u3L454X/DkSknyrMgEne6QO8iGr6HBV2iDmt3wZREAZFEsZAXAR9ghve4NiR8BRcghbQDaaF7y1EZTbTwqbJ9v8T0qHMgl5xv2gs8aFcgxO1pgck+FAioI310M8t4eYQZHnHPVz4Jd6G+dqM89jJL8a3guNXVcWcrpUHhjnHqN49CkrgFpxz9TpmiYs54nFd+o2jBVVAF8gGNIdVoW/oLqWTUdcY+GP78lSXSvlvmU5sn0+V/ot7x5uV1s5jP3elpOhWHu1QAO9+PxMcgteAUy6CEaXvUJnfAgwAoQ3O5VwgXEIAAAAASUVORK5CYII="; _qp1 = qp1 == "" || qp1 == undefined ? _qp1 : qp1;
_qp2 = qp2 == "" || qp2 == undefined ? _qp2 : qp2;
$(this).css({ "background": "url('" + _qp1 + "') no-repeat center center", "outline": "none", "cursor": "pointer" })
$(this).click(function () {
if (fullFlag) {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
fullFlag = false;
$(this).css({ "background": "url('" + _qp1 + "') no-repeat center center", "outline": "none", "cursor": "pointer" })
} else {
var element = document.documentElement;
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
fullFlag = true;
$(this).css({ "background": "url('" + _qp2 + "') no-repeat center center", "outline": "none", "cursor": "pointer" });
}
}) };
//banner图快速切换
$.fn.toggleActive = function (className) {
$(this).addClass(className).siblings().removeClass(className)
}
})(jQuery);

jQuery 扩展 全屏切换的更多相关文章

  1. jQuery插件开发——全屏切换插件

    这个插件包含三个部分:HTML结构.CSS代码和JS代码. HTML结构是固定的,结构如下: <!--全屏滚动--> <div class="fullpage-contai ...

  2. CSS jQuery 图片全屏切换

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  3. jQuery鼠标滚动垂直全屏切换代码

    体验效果:http://hovertree.com/texiao/jquery/68/ 源码下载:http://hovertree.com/h/bjaf/f643upc4.htm 代码如下: < ...

  4. jquery简单的大背景banner图片全屏切换

    详细内容请点击 这个是我初毕业刚进公司那会帮同事(同时也是同学)写的一个PC端的全屏图片切换效果,对于刚毕业的我来说写出来那会的喜悦之情是无法言表的,那时的我还是什么不懂的小白白,俗称菜鸟.个人网站上 ...

  5. jquery横向纵向鼠标滚轮全屏切换

    html <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF- ...

  6. 基于Ascensor.js全屏切换页面插件

    今天给大家分享一款基于Ascensor.js全屏切换页面插件,这款实例 适用浏览器:IE8.360.FireFox.Chrome.Safari.Opera.傲游.搜狗.世界之窗.效果图如下: 在线预览 ...

  7. 原生JS实现全屏切换以及导航栏滑动隐藏及显示——重构前

    思路分析: 向后滚动鼠标滚轮,页面向下全屏切换:向前滚动滚轮,页面向上全屏切换.切换过程为动画效果. 第一屏时,导航栏固定在页面顶部,切换到第二屏时,导航条向左滑动隐藏.切换回第一屏时,导航栏向右滑动 ...

  8. HTML5实现网页的全屏切换

    使用HTML5提供的JavaScript Api可以实现主流浏览器的全屏和退出全屏操作,封装成进入全屏和退出全屏的函数如下: //进入全屏 function enterFullScreen() { v ...

  9. VirtualBox全屏切换

    用VirtualBox的时候,如果设置为全屏,想再切换回来,没有什么菜单,只有通过键盘的快捷键来操作,才可以恢复. 我常常忘掉,所以老是得去找,以后需要记住这几个按键的快捷键. 1.全屏与非全屏切换: ...

随机推荐

  1. Uva1213(线性筛模板+dp)

    题意: 把n拆成k个不同素数的和,有多少种拆法. 解法: 打表后dp即可,这个dp的问题可以归纳为:在n个数中选k个数,使得和m的方案数 #include<cstdio> #include ...

  2. TChart-数据编辑(TChartListBox,TeeCommander)

    先上图 功能代码: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Contr ...

  3. java线程池之synchronized锁

    //Object 定义了一个引用类型的对象用于加锁 static Object Lock = new Object(); //定义一个int类型变量0做初始值 static int iCheck = ...

  4. 任意指定一个key获取该key所处在哪个node节点

    需求:任意指定一个key获取该key所处在哪个node节点上. 说明:redis自带的命令可以知道一个key所属的slot,可以知道node master对应哪些slot,但没有key和node的对应 ...

  5. CF1300E Water Balance

    题目链接 problem 给出一个长度为n的序列,每次可以选择一个区间\([l,r]\)并将区间\([l,r]\)内的数字全部变为这些数字的平均数.该操作可以进行任意多次. 求出进行任意次操作后可以得 ...

  6. 关于f(x)

    有时 z = x + y 有时 0 = x + y 有时单独用f(x) 有时 z = f(x) 很容易分不清. 从集合角度,将f(x)看成映射 即从A集合到B集合的对应关系 这样f(x)可以单独使用, ...

  7. 0013 基于DRF框架开发(01 基类视图 APIView)

    之前学习了模型序列化和普通序列化,我们用最简单的视图和url实现了对序列化的操作. 而实际上,象之前那种由DRF自动生成所有的视图和url的情况,在应用是使用很少.而需要用户根据实际业务需求,自定义视 ...

  8. 如何实现 List 集合的线程安全

    在实际项目开发中,List 集合较为常用,相比于数组,其提供了更多的方法,便于遍历.搜索.添加与移除.常见的有 ArrayList.Vector等.   关于ArrayList 中所周知,ArrayL ...

  9. 牛客寒假训练营2-C算概率

    思路 用 f(i,j) 来表示当前做了i道题,共做对了j道题 状态 f[i][j] = f[i-1][j] * (1-p[i]) + f[i-1][j-1] * p[i] 第一种:由于i-1时对了j题 ...

  10. ovs安装教程

    原文链接:https://www.cnblogs.com/goldsunshine/p/10331606.html Open vSwitch系列之二 安装指定版本ovs   Open vSwitch系 ...