How to divide a page into parts using jQuery Mobile?
Submitted by: AdministratorPages normally don't have a fixed height.
If you set a page or some element on a page to a fixed height using CSS, then you can size things in terms of %.
You'll need to use a bit of Javascript to set the page height.
Here's one way to get the device height:
var viewportHeight = document.documentElement.clientHeight;
Here's another (that I haven't tried, but should work) because jQuery Mobile sets the device height as min-height CSS for the page. (And assuming you already have a $page variable with the page.)
var viewportHeight = parseFloat($page.css('min-height'));
Then, you can:
$page.height(viewportHeight + 'px');
Submitted by: Administrator
If you set a page or some element on a page to a fixed height using CSS, then you can size things in terms of %.
You'll need to use a bit of Javascript to set the page height.
Here's one way to get the device height:
var viewportHeight = document.documentElement.clientHeight;
Here's another (that I haven't tried, but should work) because jQuery Mobile sets the device height as min-height CSS for the page. (And assuming you already have a $page variable with the page.)
var viewportHeight = parseFloat($page.css('min-height'));
Then, you can:
$page.height(viewportHeight + 'px');
Submitted by: Administrator
Read Online jQuery Mobile Job Interview Questions And Answers
Top jQuery Mobile Questions
☺ | How to divide a page into parts using jQuery Mobile? |
☺ | How to load a page using jQuery Mobile? |
☺ | How to control page titles in jQuery Mobile? |
☺ | Why we need jQuery Mobile? |
☺ | Explain jQuery UI? |
Top Scripting language Categories
☺ | AngularJS Interview Questions. |
☺ | Ext-JS Interview Questions. |
☺ | Dojo Interview Questions. |
☺ | Expert Developer JavaScript Interview Questions. |
☺ | jQuery Mobile Interview Questions. |