Viewport"
From Documentation
m ((via JWB)) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{ZKComponentReferencePageHeader}} | {{ZKComponentReferencePageHeader}} | ||
+ | {{versionSince| 6.5.0}} | ||
= Viewport Content = | = Viewport Content = | ||
The default viewport content generated in ZK when using tablet device is: | The default viewport content generated in ZK when using tablet device is: | ||
Line 8: | Line 9: | ||
= Customize = | = Customize = | ||
− | + | Users can specify viewport settings by library properties or XML processing instructions. | |
== Library Properties == | == Library Properties == | ||
− | + | {{versionSince| 6.5.0}} | |
− | The default value of [[ZK_Configuration_Reference/zk.xml/The_Library_Properties/org.zkoss.zul.tablet.meta.viewport.disabled|org.zkoss.zul.tablet.meta.viewport.disabled]] property is <code>false</code>. If it is set to <code>true</code>, ZK won't render viewport content for all pages. Thus, | + | The default value of [[ZK_Configuration_Reference/zk.xml/The_Library_Properties/org.zkoss.zul.tablet.meta.viewport.disabled|org.zkoss.zul.tablet.meta.viewport.disabled]] property is <code>false</code>. If it is set to <code>true</code>, ZK won't render viewport content for all pages. Thus, users can specify the viewport on each ZUL page by [[ZUML_Reference/ZUML/Processing_Instructions/meta|meta instruction]]. |
== XML processing instruction == | == XML processing instruction == | ||
− | + | Users can keep the default setting and assign custom viewport on specific pages by overwriting viewport content in [[ZUML_Reference/ZUML/Processing_Instructions/page|page instruction]] as follows: | |
− | |||
<source lang="xml"> | <source lang="xml"> | ||
<?page viewport="width=device-width, initial-scale=1.0"?> | <?page viewport="width=device-width, initial-scale=1.0"?> | ||
</source> | </source> | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{{ZKComponentReferencePageFooter}} | {{ZKComponentReferencePageFooter}} |
Latest revision as of 08:21, 24 October 2023
Since 6.5.0
Viewport Content
The default viewport content generated in ZK when using tablet device is:
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
Customize
Users can specify viewport settings by library properties or XML processing instructions.
Library Properties
Since 6.5.0
The default value of org.zkoss.zul.tablet.meta.viewport.disabled property is false
. If it is set to true
, ZK won't render viewport content for all pages. Thus, users can specify the viewport on each ZUL page by meta instruction.
XML processing instruction
Users can keep the default setting and assign custom viewport on specific pages by overwriting viewport content in page instruction as follows:
<?page viewport="width=device-width, initial-scale=1.0"?>