viewport


Script For Assigning Viewport Meta Parameters, iPhone / iPad Conundrum

拜拜、爱过 提交于 2020-01-24 17:05:26
问题 I am using a JavaScript snippet to set the content parameters of the viewport meta tag, based on the width of the browser window. The script does almost what it should: it sets the initial scale value for any large screen device as 1, for iPad in portrait mode as 0.5, and for any devices smaller than 700px in screen width, back to 1. However, it seems to ignore the value assigned for iPad in landscape mode: 0.75. I suspect somehow I incorrectly the conditional for width in the landscape mode.

iOs orientation widht and height are smaller than it sould be

自古美人都是妖i 提交于 2020-01-16 07:42:23
问题 I have an issue running my ionic application on iOs real devices (tested on iPhone 4 and iPad 4th generation). All is woking perfectly on android phones, tablets ans iOs emulators. (This is the orientation plugin I am using: cordova-plugin-screen-orientation) My app is locked in the portrait mode and by clicking on a button I pass to another page which locks the landscape orientation. (All is going well till now) When I click the back button to return to the portrait oriented page, it rotates

Check if viewport zoomed

风格不统一 提交于 2020-01-16 02:51:23
问题 Is there an easy way to check whether the user scaled the page (using pinch on mobile devices)? Thought verge.js would help, but I don't know what I can compare viewportH with. 回答1: You can compare the screen.width to the window.innerWidth. If the value is anything other than 1, the viewport has been zoomed. viewportScale = screen.width / window.innerWidth; alert(viewportScale); References: https://developer.mozilla.org/en-US/docs/Web/API/Window.screen https://developer.mozilla.org/en-US/docs

Check if viewport zoomed

左心房为你撑大大i 提交于 2020-01-16 02:51:09
问题 Is there an easy way to check whether the user scaled the page (using pinch on mobile devices)? Thought verge.js would help, but I don't know what I can compare viewportH with. 回答1: You can compare the screen.width to the window.innerWidth. If the value is anything other than 1, the viewport has been zoomed. viewportScale = screen.width / window.innerWidth; alert(viewportScale); References: https://developer.mozilla.org/en-US/docs/Web/API/Window.screen https://developer.mozilla.org/en-US/docs

Measuring the window offset

心已入冬 提交于 2020-01-14 22:53:47
问题 Is there a way to measure the offset of the window in jQuery, in order than I might compare the positions of a 'fixed' element and a relatively positioned one? I need to be able to tell how far the window is scrolled so I can use the figure to calculate the difference between the height of the fixed element (which is relative to the viewport top) and the relative object (which is relative to the top of the document) 回答1: $(window).scrollTop() and $(window).scrollLeft() can be used to find

Scale HTML content using JQuery Mobile & Phonegap

拟墨画扇 提交于 2020-01-14 14:16:10
问题 I need to dynamically load content from HTML emails into some type of content area within my HTML so that it is scaled to fit, exactly the way the native mail apps do for iPhone/Android. I have spent two days Googling and testing to no avail. I'm loading the HTML content (which is often set to width=600 or something nice), but rather than scaling, it is appearing as follows: iPhone Simulator Example The HTML is very simple: <div data-role="page" id="messagedetailpage" data-add-back-btn="true"

Scale HTML content using JQuery Mobile & Phonegap

一曲冷凌霜 提交于 2020-01-14 14:15:51
问题 I need to dynamically load content from HTML emails into some type of content area within my HTML so that it is scaled to fit, exactly the way the native mail apps do for iPhone/Android. I have spent two days Googling and testing to no avail. I'm loading the HTML content (which is often set to width=600 or something nice), but rather than scaling, it is appearing as follows: iPhone Simulator Example The HTML is very simple: <div data-role="page" id="messagedetailpage" data-add-back-btn="true"

How do I scroll JScrollPane viewport containing a JPanel to a specific location

吃可爱长大的小学妹 提交于 2020-01-14 10:23:41
问题 I am trying to create a large game board that only part of it will be visible in the viewport and would like to be able to move the viewport around using the arrow keys to see the whole board. Right now I have a JScrollPane that contains a JPanel that will have Images and text and other stuff, but those are irrelevant. Right now I have an ImageIcon at the same size as the JPanel as a background and I would like to have an option to move the viewport around by using keys, and not have any

How do I scroll JScrollPane viewport containing a JPanel to a specific location

拈花ヽ惹草 提交于 2020-01-14 10:23:31
问题 I am trying to create a large game board that only part of it will be visible in the viewport and would like to be able to move the viewport around using the arrow keys to see the whole board. Right now I have a JScrollPane that contains a JPanel that will have Images and text and other stuff, but those are irrelevant. Right now I have an ImageIcon at the same size as the JPanel as a background and I would like to have an option to move the viewport around by using keys, and not have any

Get div to show/hide when scrolling for a “back to top” link

我只是一个虾纸丫 提交于 2020-01-12 08:38:09
问题 I can't make my "go to top" id=arrow-up div to disappear when on e.g. top of the page. At the top of the page I got So I would like the arrow-up div to visible(show("slow")) when not on top of the page. var tmp = $(window).height(); Tmp is used to get the viewport height... Not sure if that is right? I have seen other solutions but they are only kind of the same... and I can't make them work, also they font use :in-viewport . Can I make it with viewport or am I side tracked? <script type=

工具导航Map