viewport

When using “Viewport Height/vh” in CSS does it include the “browser bookmark bar” in the total?

筅森魡賤 提交于 2019-12-08 07:33:12
问题 In Chrome, the bookmarks bar is disabled with command+shift+b. Should I always be testing sites with this disabled for the browser to truly be "100%"? Or does having this enabled actually make the "vh 95%" for example? 回答1: vh uses the size of the viewport. So if you have the bookmarks bar open, then your viewport height is going to be smaller. Would be similar to just resizing your window and make the height smaller. https://www.w3.org/TR/css-values-3/#viewport-relative-lengths The viewport

Resize viewport, crop scene

别等时光非礼了梦想. 提交于 2019-12-08 06:05:25
问题 I have a 3d scene drawn by OpenGL to a resizeable window. Now, when the window gets resized, I do not want to scale the viewport, rather I want to keep the scene at a fixed size and show a larger portion of it (or crop the scene image). This is my current code: GLfloat ratio; // Protect against a divide by zero if ( height == 0 ) height = 1; ratio = ( GLfloat )width / ( GLfloat )height; // Setup our viewport. glViewport( 0, 0, ( GLint )width, ( GLint )height ); // change to the projection

jQuery Show/Hide Div when Section is in Viewport

北城以北 提交于 2019-12-08 05:57:18
问题 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,

True mobile screen emulator ?

梦想与她 提交于 2019-12-08 05:48:18
问题 I have this page : http://people.opera.com/andreasb/viewport/ex01.html Which uses viewport for different mobile screen sizes. When I run this at my iphone I do see the font changes : But when I use Ripple or other chrome extensions (which I found) , it doesnt show me the increased font size. only screen size is changing. ( but it doesnt affect the font size ) How can I emulate ( chrome extension) the screen size so it will show me as if I'm on real mobile ? 回答1: You don't need a Chrome

Altering meta viewport tag

别等时光非礼了梦想. 提交于 2019-12-08 05:44:07
问题 I need to alter the meta viewport tag dependent upon the width of the visual viewport. I know HOW to do it but it's not working, I think it's because the site is running that bit of JS too late for it to take effect. It may not be this but this is my first thought. In my application.js file: $(document).ready(function() { // If screen width is 480 or less then add meta viewport tag // (so default mobile display is used on iPads until that optimised view is added) if (window.innerWidth <= 480)

Real coordinates for graph inside viewport relative to mouse coordinates

独自空忆成欢 提交于 2019-12-08 05:27:59
问题 As I have specified in the title, I have started to work on a simple application what contains in the main frame window, a double buffered panel. Inside this panel some graphics can be drawn, let's consider this panel is a simple viewport for the elements drawn inside. Two functionalities were added here, pan and zoom what can scale transform and translate transform inside paint event using a delta updated on MouseDown and Move events and OnMouseWheel for updating the scale transform. The

css字体大小自适应窗口

天大地大妈咪最大 提交于 2019-12-08 03:47:30
css字体大小自适应窗口 font-size 1vw = 1% of viewport width 窗口宽度的1% 1vh = 1% of viewport height 窗口高度的1% vmax vw和vh中最大的一个 vmin vw和vh中最小的一个 #content { position : absolute ; z-index : 1 ; font-family : hanwei ; /* font-size: 5rem; */ font-size : 3vw ; } 效果图 来源: CSDN 作者: 宋大王 链接: https://blog.csdn.net/JsongNeu/article/details/89889780

galaxy S3.. viewport meta tag doesns't work

谁说我不能喝 提交于 2019-12-08 03:18:45
问题 I'm currently working on the web app which use medium-dpi in viewport meta tag like the below. <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width, user-scalable=no, target-densitydpi=medium-dpi" /> When I test it on a galaxy S3 device, viewport seems not work correctly. I saw this kind of thing in Android 4.0.2. In android 4.0.2, i heard android OS itself has bug that can't apply the viewport correctly. Anybody has any idea?? 回答1: I

Visual viewport detection in Firefox mobile browser

蓝咒 提交于 2019-12-08 02:36:29
As the subject says, I need these zoom-tainted viewport dimensions (CSS-pixels) in Firefox mobile browser. How do I extract that? In webkit browsers it goes by window.innerWidth / innerHeight and works fine, but I just can't find the corresponding values for Firefox. I had the same problem and came up with the following solution: Place a zero-pixel size "dummy" div in the bottom right corner of the screen (using "position:fixed") and query its position via getBoundingClientRect().left/top, which gives the width/height of the visual viewport. Example code (querying only the width): <div id=

移动端常见的一些兼容性问题

百般思念 提交于 2019-12-08 02:17:30
随着手机的普及,移动端的开发也成了一个重要的方向,但由于设备的不统一会造成一些兼容性问题, 1、安卓浏览器看背景图片,有些设备会模糊。 用同等比例的图片在PC机上很清楚,但是手机上很模糊,原因是什么呢? 经过研究,是devicePixelRatio作怪,因为手机分辨率太小,如果按照分辨率来显示网页,这样字会非常小,所以苹果当初就把iPhone 4的960*640分辨率,在网页里只显示了480*320,这样devicePixelRatio=2。现在android比较乱,有1.5的,有2的也有3的。 想让图片在手机里显示更为清晰,必须使用2x的背景图来代替img标签(一般情况都是用2倍)。例如一个div的宽高是100*100,背景图必须得200*200,然后background-size:contain;,这样显示出来的图片就比较清晰了。 代码可以如下: background:url(../images/icon/all.png) no-repeat center center; -webkit-background-size:50px 50px; background-size: 50px 50px;display:inline-block; width:100%; height:50px; 或者指定 background-size:contain;都可以,大家试试! 2、图片加载