zoukankan      html  css  js  c++  java
  • 自定义属性和充满屏幕

     <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
    </head>
    <body>
           <div>
               <img src="././../../../数据库/图片//png图片//bilibili.png" alt="">
           
            <input type="button" id="full" value="全屏">
            <input type="button" id="noFull" value="退出全屏">
            <input type="button" id="isFull" value="是否是全屏">
           </div>
            <script>
             window.onload=function(){
                 var div=document.querySelector("div");
                 document.querySelector("#full").onclick=function(){
                    if(div.webkitRequestFullScreen){
                        div.webkitRequestFullScreen();
                    }else if(div.msRequestFullScreen){
                        div.msRequestFullScreen();
                    }else if(div.mozRequestFullScreen){
                        div.mozRequestFullScreen();
                    }else{
                        div.requestFullScreen();
                    }
                 }
              
                //  document.querySelector("#noFull").onclick=function(){
                //      div.cancelFullScreen();
                //  }
                 
                //  document.querySelector("#isFull").onclick=function(){
                //      div.fullScreenElement();
                //  }
             } 
            </script>
    </body>
    </html> 
    <!--
    1.requestFullScreen();开启全屏显示  不同浏览器不同的前缀 firebox :moz IE:ms spera:o
    2.cancelFullScreen();关闭全屏显示
    3.fullScreenElement();是否是全屏状态
    
    
     <!-- 网络接口
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
    </head>
    <body>
        <script>
            //ononline当网络连接的时候触发
        window.addEventListener("online",function(){
            alert('有网');
        });    
        //onoffline 无网的时候触发
        window.addEventListener("offline",function(){
            alert('没网');
        }); 
        </script>
    </body>
    </html>
    
     
    
    <!--自定义属性 
        <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
    </head>
    <body>
    
        <p data-school-name="itcast">王星宇</p>
    
        <script> 
         window.onload=function(){
             var p=document.querySelector('p');
             var  value=p.dataset["schoolName"];
             console.log(value);
         }
        </script>
    </body>
    </html> 
    
    
        dete-开头 date-后至少有一个字符,多个单词使用-连接
  • 相关阅读:
    BZOJ 2655: calc(拉格朗日插值)
    BZOJ 1485: [HNOI2009]有趣的数列(卡特兰数)
    [学习笔记] 关于组合数的一些总结
    CF 1076E Vasya and a Tree(线段树+树剖)
    CF 1082E Increasing Frequency(贪心)
    51nod 1149 Pi的递推式(组合数学)
    LOJ 2743(洛谷 4365) 「九省联考 2018」秘密袭击——整体DP+插值思想
    关于 unsigned int 比较大小
    洛谷 3295 [SCOI2016]萌萌哒——并查集优化连边
    洛谷 P4512 [模板] 多项式除法
  • 原文地址:https://www.cnblogs.com/wxy0715/p/12442082.html
Copyright © 2011-2022 走看看