开发者社区> 问答> 正文

JQuery mobile 怎么设置默认横屏

用jquery画的一个表格在手机竖屏的时候,列如果多的时候,会很别扭。想知道如何进入页面的时候设置默认横屏显示

展开
收起
a123456678 2016-07-11 14:43:41 2809 0
1 条回答
写回答
取消 提交回答
  • <!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>orientationchange demo</title>
      <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
      <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
      <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
    </head>
    <body>
      
    <h1 id="orientation">orientationchange Not Supported on this Device.</h1>
      
    <script>
    // Bind an event to window.orientationchange that, when the device is turned,
    // gets the orientation and displays it to on screen.
    $( window ).on( "orientationchange", function( event ) {
      $( "#orientation" ).text( "This device is in " + event.orientation + " mode!" );
    });
      
    // You can also manually force this event to fire.
    $( window ).orientationchange();
    </script>
      
    </body>
    </html>
    2019-07-17 19:54:11
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关课程

更多

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载