Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css jQuery移动定位更改解决方案_Css_Jquery Mobile_Orientation_Landscape_Portrait - Fatal编程技术网

Css jQuery移动定位更改解决方案

Css jQuery移动定位更改解决方案,css,jquery-mobile,orientation,landscape,portrait,Css,Jquery Mobile,Orientation,Landscape,Portrait,我正在开发一个jQuery移动应用程序。它有大量动态生成的CSS,到目前为止,我一直在开发面向肖像的一切。明显的问题是,当我倾斜我的设备时,它看起来非常糟糕。我不需要为应用程序设置一个横向视图,但我也不反对。有人能推荐一个最简单的解决方案吗?选项是横向视图还是以某种方式将应用程序锁定在纵向模式?有两种方法可以检查方向。。 首先 一, 第二,使用css,你可以使用min width进行检查。我使用iPad,然后检查768和1024。做这些事情 @media screen and (min-widt

我正在开发一个jQuery移动应用程序。它有大量动态生成的CSS,到目前为止,我一直在开发面向肖像的一切。明显的问题是,当我倾斜我的设备时,它看起来非常糟糕。我不需要为应用程序设置一个横向视图,但我也不反对。有人能推荐一个最简单的解决方案吗?选项是横向视图还是以某种方式将应用程序锁定在纵向模式?

有两种方法可以检查方向。。 首先 一,

第二,使用css,你可以使用min width进行检查。我使用iPad,然后检查768和1024。做这些事情

@media screen and (min-width: 768px){
    #realTimeContents {
   overflow-y:auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  height:850px 

}
}
@media screen and (min-width: 1024px){
    #realTimeContents {
   overflow-y:auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  height:600px 

}
}

谢谢你的回答。你能详细说明一下实施情况吗?我将代码粘贴到一个样式标记中,它什么也没做。这也是正确的语法吗?谢谢你的更新。我已经成功地使用您给出的第一条javascript消息检测到方向更改,但是我无法调整方向更改的css。但是css是另一种方式。我总是使用css。好的,请勾选答案,以便其他人也使用此答案。我无法从您的答案中实现解决方案。我的问题是如何调整方向变化,而不是如何检测方向变化。
@media screen and (min-width: 768px){
    #realTimeContents {
   overflow-y:auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  height:850px 

}
}
@media screen and (min-width: 1024px){
    #realTimeContents {
   overflow-y:auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  height:600px 

}
}