viewport

CSS响应式设计之Viewport

匆匆过客 提交于 2019-12-09 15:24:43
移动前端开发之viewport的深入理解 在移动设备上进行网页的重构或开发,首先得搞明白的就是移动设备上的viewport了,只有明白了viewport的概念以及弄清楚了跟viewport有关的meta标签的使用,才能更好地让我们的网页适配或响应各种不同分辨率的移动设备。 一、viewport的概念 通俗的讲,移动设备上的viewport就是设备的屏幕上能用来显示我们的网页的那一块区域,在具体一点,就是浏览器上(也可能是一个app中的webview)用来显示网页的那部分区域,但viewport又不局限于浏览器可视区域的大小,它可能比浏览器的可视区域要大,也可能比浏览器的可视区域要小。在默认情况下,一般来讲,移动设备上的viewport都是要大于浏览器可视区域的,这是因为考虑到移动设备的分辨率相对于桌面电脑来说都比较小,所以为了能在移动设备上正常显示那些传统的为桌面浏览器设计的网站,移动设备上的浏览器都会把自己默认的viewport设为980px或1024px(也可能是其它值,这个是由设备自己决定的),但带来的后果就是浏览器会出现横向滚动条,因为浏览器可视区域的宽度是比这个默认的viewport的宽度要小的。下图列出了一些设备上浏览器的默认viewport的宽度。 二、css中的1px并不等于设备的1px 在css中我们一般使用px作为单位

jQuery: Fullscreen “background” image that moves according to mouse position [closed]

我们两清 提交于 2019-12-09 07:48:20
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I am trying implement a full screen background that moves according to the position of the mouse position. So for example, if you were to move the mouse to the top left, the view port would show the top left of the image and the rest of the image that can fit into the view port. In this case, let's say - the

DirectX 11的初始化

北城余情 提交于 2019-12-09 00:05:30
总体来说可以概括为以下几个步骤: 创建Device和Context 创建SwapChain 为BackBuffer创建View 创建Depth/Stencil Buffer,并为之创建View 将View绑定到Context中 设置Viewport 创建Device和Context HRESULT D3D11CreateDevice( IDXGIAdapter *pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, const D3D_FEATURE_LEVEL *pFeatureLevels, UINT FeatureLevels, UINT SDKVersion, ID3D11Device **ppDevice, D3D_FEATURE_LEVEL *pFeatureLevel, ID3D11DeviceContext **ppImmediateContext ); 主要调用D3D11CreateDevice创建ID3D11Device和ID3D11DeviceContext。接口说明可以查看API文档。这里注意第四个参数Flags。在Windows10系统下,如果要设置为D3D11_CREATE_DEVICE_DEBUG,则必须安装DirectX Graphics Tools。 参见

jQuery Show/Hide Div when Section is in Viewport

耗尽温柔 提交于 2019-12-08 14:25:36
My code at the moment is here: http://www.jaygeorge.co.uk/gwennan-sage You'll see two green arrows that are in a fixed position at the bottom of the page. I'm having trouble getting jQuery to hide these divs (#timeline-buttons) when the Timeline section is NOT in view, preferably using the fade() technique. I've tried a Viewport plugin but can't get it to work properly with if statements, I'm sure it can be done with normal jQuery by measuring div heights somehow. Any advice appreciated, thanks in advance. Hide the green arrows and then onscrolling, test to see if the timeline div position is

Android Changing densityDPI in java

二次信任 提交于 2019-12-08 13:02:43
问题 Dose any one know how to change the densityDpi for an android app in java? I'm working on an android application where i manipulate the target density in the viewpoint tag. This is causing a minor problem in some place of the apps, the target density seems to be reset by the soft keyboard. So I need a way to reset this, or prevent the keyboard from changing the density. 回答1: For devices like the lenovo A1 (tablet with 240dpi density) or the galaxy note you may need to do this in your app to

Determine actual viewing size in browser

夙愿已清 提交于 2019-12-08 12:21:07
问题 I am trying to determine the actual viewPORT size of the current browser window. I've tried: window.innerHeight/innerWidth document.documentElement.clientHeight/clientWidth document.body.clientHeight/clientWidth All return the full page size and NOT the viewing area. What I'm trying to ultimately achieve is forcing a popup menu to appear on screen (in the viewport). Right now when it is shown, it might show below the scroll and the users are not happy with that. I know the x,y of where they

Phonegap + jqMobi / Intel App Framework causes constant screen resize

[亡魂溺海] 提交于 2019-12-08 11:37:08
问题 Somehow when I try a basic example of Intel App Framework in a Phonegap project, the screen constantly keeps resizing (leaving a white space of the size of the virtual keyboard and back to 100% height). When I try out the site in a browser everything is fine... I tried every viewport setting that I could think of....something is causing this behaviour, but what? 回答1: The problem is that the 'afui' div is absolute-positioned. The following css fixes this : #afui { position: static; } 来源: https

JqueryTools overlay position based on window size

和自甴很熟 提交于 2019-12-08 10:39:43
问题 I'm using JqueryTools overlay, running into a frustrating issue where the overlay only positions itself from the screen viewport instead of the HTML top edge. I haven't found any solutions so far. Can someone shed some light on to achieve this? Others are having the same issue. Are there alternatives to overlays? The reason I picked Jquery tools, I can use any background image and customize bunch of different things. Here is the same issues listed on Jquery overlay forum. "The problem seems

Draw texture according to viewport and camera

陌路散爱 提交于 2019-12-08 10:12:01
问题 I don't manage to draw my textures so that they are resized according to the screen resolution. I am using ScreenViewport (as I want my font to be smooth and without distorsion). float w = Gdx.graphics.getWidth(); float h = Gdx.graphics.getHeight(); gameCam = new OrthographicCamera(2f * h/w, 2f); gamePort = new ScreenViewport(gameCam); Weirdly, whatever the height and width of the camera the result is the same. In the resize method, I tried a lot of things : @Override public void resize(int

Does meta viewport override fixed element width

徘徊边缘 提交于 2019-12-08 09:27:12
问题 I have a simple question related to viewport.. I have a page which has a div with a fixed width of say 1200px..Now i set meta viewport to device-width So my question is how will the page be rendered now? Will the fixed width of 1200px be respected and viewport will be ignored OR will the device width override any fixed width on the page? Also will this rendering behavior be same across all mobile browsers? Just to add, i have already gone through the nice article on http://www.quirksmode.org