viewport

Calculating Viewport Height on Chrome Android with CSS

你离开我真会死。 提交于 2019-11-28 18:25:36
So I noticed that mobile Chrome calculates the address bar into the viewport height. Because of this using height: 100vh on an element doesn't work because when the address bar scrolls the viewport height changes. I was actually able to find a question that had the same issue here on ios, but after investigating further I realized that this happens on all mobile Chrome browsers. When the address bar scrolls out of the viewport and then again when scrolls into the viewport, the viewport height changes. This causes any element using vh to recalculate which makes the page jump. It's extremely

How to use multiple viewports in OpenGL?

眉间皱痕 提交于 2019-11-28 18:16:27
I need to show the same object in OpenGL in two different viewports, for instance, one using ortographic projection and the other using perspective. In order to do this, do I need to draw again the object after each call to glViewport()? Nehe has a good tutorial on how to do this, and his site is generally a good resource for OpenGL questions. // normal mode if(!divided_view_port) glViewport(0, 0, w, h); else { // right bottom glViewport(w/2, h/2, w, h); glLoadIdentity (); gluLookAt(5.0f, 5.0f, 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); display(); // left bottom glViewport(0, h/2, w/2, h);

HTML5 Boilerplate: Meta viewport and width=device-width

99封情书 提交于 2019-11-28 17:03:16
问题 I'm building an adaptive/responsive website. Regarding this recent change to the HTML5BP: "mobile/iOS css revisions" I've started using: <meta name="viewport" content="width=device-width"> ... and I have this in my CSS: html { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } When initial-scale=1 was included, rotating from vertical to horizontal (on iPad/iPhone) caused the layout to change from 2 columns (for example) to 3 columns (due to meida queries, initial-scale=1 and JS fix

How can I force a site to scale to fix for mobile (Iphone android..)

◇◆丶佛笑我妖孽 提交于 2019-11-28 16:12:44
When I load my site in an iphone it doesn't scale down. All I see is the top-left most couple hundred sqare pixels. I am new to mobile optimization, but I feel like most pages scroll to fit automatically, and most questions seem to be for the opposite scenario that I am having (force phone not to scale down). I would want the whole page width to be visable and to make it so the user would have to zoom in to read the text. I have tried with and without the following code in the head, but with no apparent effect. <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- I Also

Disable Pinch Zoom on Mobile Web

你。 提交于 2019-11-28 15:17:36
问题 I want to disable Pinch and Zoom on Mobile devices. What configuration should I add to the viewport ? Link : http://play.mink7.com/n/dawn/ 回答1: EDIT: Because this keeps getting commented on, we all know that we shouldn't do this. The question was how do I do it, not should I do it. Add this into your for mobile devices. Then do your widths in percentages and you'll be fine: <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> Add this

Difference between visual viewport and layout viewport?

ぃ、小莉子 提交于 2019-11-28 15:12:54
What is the Difference between visual viewport and layout viewport for a mobile device like iPhone/iPad? I have gone through a lot of online resources, but am still unclear about it. The visual viewport is the part of the page that’s currently shown on-screen. The layout viewport can be considerably wider than the visual viewport, and contains elements that appear and do not appear on the screen. Imagine the layout viewport as being a large image which does not change size or shape. Now imagine you have a smaller frame through which you look at the large image. The small frame is surrounded by

Bootstrap框架

社会主义新天地 提交于 2019-11-28 15:06:35
Bootstrap框架 Bootstrap介绍 Bootstrap是Twitter开源的基于HTML、CSS、JavaScript的前端框架。 它是为实现快速开发Web应用程序而设计的一套前端工具包。 它支持响应式布局,并且在V3版本之后坚持移动设备优先。 为什么要使用Bootstrap? 在Bootstrap出现之前: 命名:重复、复杂、无意义(想个名字费劲) 样式:重复、冗余、不规范、不和谐 页面:错乱、不规范、不和谐 在使用Bootstrap之后: 各种命名都统一并且规范化。 页面风格统一,画面和谐。 Bootstrap下载 官方地址:https://getbootstrap.com 中文地址:http://www.bootcss.com/ 我们使用V3版本的Bootstrap,我们下载的是用于生产环境的Bootstrap。 Bootstrap环境搭建 目录结构: bootstrap-3.3.7-dist/ ├── css // CSS文件 │ ├── bootstrap-theme.css // Bootstrap主题样式文件 │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css // 主题相关样式压缩文件 │ ├── bootstrap-theme.min.css.map │ ├── bootstrap

How Camera works in Libgdx and together with Viewport

好久不见. 提交于 2019-11-28 14:47:09
If you work with LibGdx it goes not long until you come to Camera and viewport. If you work the first time with camera and Viewport you get some questions about how it works and how to use it. So: How can I use a Camera in LibGdx? What's viewport width and height? What is a Viewport, how can I use it and how it works together with the Camera? How can I use a Camera in LibGdx? What's viewport width and height? Firstly it's important that you know the Camera works with World units not with Pixels. World units are not a regular Unit. You self can define how much one World Unit is. Later more.

LibGdx-ViewPort width and height does not match for some devices

你离开我真会死。 提交于 2019-11-28 14:34:38
I am using a Viewport for my libGdx landscape game like this. public static final int WORLD_WIDTH = 1280; public static final int WORLD_HEIGHT = 800; camera = new OrthographicCamera(); float aspectRatio = Constants.WORLD_WIDTH / Constants.WORLD_HEIGHT; ViewPort viewPort = new FillViewport(WORLD_WIDTH * aspectRatio,WORLD_HEIGHT, camera); I am using all positions in terms of this width and height. It is working fine in all devices except device that have screen resolution greater than 1300. In device that have greater resolution than 1300,only middle part of the game is visible.I tried using

修改Ubuntu登录界面分辨率过高的问题

跟風遠走 提交于 2019-11-28 14:04:43
在虚拟机中安装UBuntu后,登录界面的分辨率一直过高,导致每次输入登录名和密码都要拖动,很是不方便;修改屏幕分辨率也无济于事。到网上查了一些资料,也没找到合适的资料。 今天安装VMwareTools时发现在安装过程中有一个分辨率的提示,由于是英文,只是大概看了看,没有仔细阅读,安装完毕后重启,发现登录界面的分辨率已经变为1024x768(正是安装过程中提示的分辨率)。 后来,在/ect/X11/下,发现多了一个xorg.conf.BeforeVMwareToolsInstall文件,看来是由于安装VMwareTools修改了配置文件。于是进行对照,发现原来的 Section "Screen" Identifier "Default Screen" Device "VMware Inc [VMware SVGA II] PCI Display Adapter" Monitor "Generic Monitor" DefaultDepth 24 EndSection 被修改为: Section "Screen" Identifier "Default Screen" Device "VMware SVGA" Monitor "vmware" # Don't specify DefaultColorDepth unless you know what you're # doing.