当前位置: 首页 > 网络学院 > XML相关教程 > WAP > <onevent>
The <onevent> tag contains code to be executed when one of the following events occurs: onenterbackward, onenterforward, onpick, ontimer.
<onevent>标签包含了下述事件发生时所执行的代码:onenterbackward、onenterforward、onpick、ontimer。
<onevent type="type"> ..code.. </onevent> |
属性 | 值 | 描述 |
---|---|---|
type | onenterbackward onenterforward onpick ontimer | REQUIRED. Specifies the type of the "onevent" element. 必要参数。指定“onevent”元素的类型 onenterbackward - Triggered when a <prev> goes to a previous card |
class | cdata | Sets a class name for the element. The class name is case sensitive. An element can be connected to multiple classes. Multiple class names within the class attribute are separated by white space 为元素设置一个类名称。类名称是字母大小写不敏感的。一个元素可以被连接到多个类中。类属性中的多个类名称是通过空白符进行分隔的 |
id | id | Sets a unique name for the element 为元素设置一个独立的名称 |
The example below uses the <onevent> tag to always navigate to card1 when an onenterbackward event occurs: 下述案例中,当onenterbackward事件触发时,使用<onevent>标签对card1进行操作: <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <template> <onevent type="onenterbackward"> <go href="#card1"/> </onevent> </template> <card id="card1" title="Card 1"> <p> Hello World! </p> </card> <card id="card2" title="Card 2"> <p> From RuanChen! </p> </card> </wml> |