来自专栏 XForms · 第 51 篇,共 137 篇
Motivation
You want to conditionally display different areas of the screen based on static IDs.
Screen Image
As you click on one of the three buttons on the top row, the view displayed below will change.
Link to XForms Application
Sample Program
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events">
Switch, case and toggle
type="text/css">
@namespace xf url("http://www.w3.org/2002/xforms");
xf|group {
border: solid black 2px;
background-color: silver;
height: 100px;
}
xf|group xf|label {
position: relative;
font-family: Helvetica, sans-serif;
font-weight: bold;
background-color: white;
padding: 2px;
top: -10px;
left: 10px;
}
xf|group p {
position: relative;
top: -30px;
padding: 5px;
}
]]>
/>
View One
case="case-1" ev:event="DOMActivate" />
View Two
case="case-2" ev:event="DOMActivate" />
View Three
case="case-3" ev:event="DOMActivate" />
/>
/>
id="case-1">
View One
One One One One One One One One One One One One One One One One One One
id="case-2">
View Two
Two Two Two Two Two Two Two Two Two Two Two Two Two Two Two Two Two
id="case-3">
View Three
Three Three Three Three Three Three Three Three Three Three Three Three Three Three Three Three Three
Discussion
XForms provides an easy ways to swap between views. This also shows how the XForms group and label can be used like the HTML fieldset and legend.
Where this page came from
This page was imported from Wikibooks. From “XForms” on Wikibooks, by its contributors, under CC BY-SA 4.0. Changed here: set as a page; navigation and edit links left out; each image under its own licence, credited in its caption.
Nobody has written it yet — it is the source material at a new address, which is why search engines are asked to skip it and why no one earns from it. It is up for grabs: take it on, and it is yours to rewrite and to earn from.
收录于这些专栏XForms
许可协议: CC BY-SA 4.0 · 改编自 en.wikibooks.org
1
0
0
0

留言






