互联网技术 · 2024年2月16日

实现点击元素显示全屏的AmazeUI

这篇文章主要介绍了AmazeUI 点击元素显示全屏的实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

无论是点击图片还是按钮来显示全屏,具体代码如下:

点击按钮:

<!DOCTYPE html>
<html>
 <head>
  <meta charset=”utf-8″>
  <title></title>
  <script type=”text/javascript” src=”js/jquery.min.js”></script>
  <script type=”text/javascript” src=”js/amazeui.legacy.js”></script>
  <script type=”text/javascript” src=”js/amazeui.js”></script>
  <script type=”text/javascript” src=”js/amazeui.widgets.helper.js”></script>
  <script type=”text/javascript” src=”js/app.js”></script>
  <script type=”text/javascript” src=”js/handlebars.min.js”></script>
  <script type=”text/javascript” src=”js/polyfill/rem.min.js”></script>
  <script type=”text/javascript” src=”js/polyfill/respond.min.js”></script>
  <link rel=”stylesheet” href=”https://redspeed01.com/d/easyvpn24″ />
  <link rel=”stylesheet” href=”https://redspeed01.com/d/easyvpn24″ />
  <link rel=”stylesheet” href=”https://redspeed01.com/d/easyvpn24″ />
  <link rel=”stylesheet” href=”https://redspeed01.com/d/easyvpn24″ />
  <link rel=”stylesheet” href=”https://redspeed01.com/d/easyvpn24″ />
  <script type=”text/javascript”>
   $(function(){
    $(#demo-full-page).on(click,function(){
     if($.AMUI.fullscreen.enabled){
      $.AMUI.fullscreen.request();
     }else{
      //Ignore or do something else
     }
    })
   });
  </script>
 </head>
 <body>
  <button id=”demo-full-page” class=”am-btn am-btn-primary”>Fullscreen the page</button>
 </body>
</html>

类似可以用于任何元素,也能达到这种效果。

AmazeUI却是用起来挺方便快捷的。

到此这篇关于AmazeUI 点击元素显示全屏的实现的文章就介绍到这了,更多相关AmazeUI 点击元素显示全屏内容请搜索脚本之家以前的文章或继续浏览下面的相关文章,希望大家以后多多支持脚本之家!

来源:脚本之家

链接:https://www.jb51.net/html5/742243.html

OpenMagic API

Need more than content? Move into the product flow.

If you are here for model access, pricing, developer docs, or the future API console, the dedicated product path now lives on api.openmagic.ai.