WML初级教程之关于WML的事件

80酷酷网    80kuku.com

  教程

  内部事件(onevent)

  相关属性:

  type:内部事件的触发条件,当前浏览器状态满足触发条件时,浏览器就会触发这个条件下设置的,内部事件总共有4种触发条件。

   1 ontimer 满足时钟设置的条件时,该条件成立。关于时钟设置问题,后面还有专门的说明。
   2 onenterbackward 通过prev或其他外部命令返回到当前card,该条件成立。
   3 onenterforward 当浏览器通过链接进入当前card,该条件成立
   4 onpick 在使用option控件列表的时候,任何点击控件的行为都会触发本事件,包括选择和去掉选择。

  示例:

<?xml version="1.0"?>
<!doctype wml "-//wapforum//dtd wml 1.1//en" "http://www.wapforum.com/dtd/wml_1.1.xml">
<wml>

<!-- this deck can't use in ericsson r320sc ,because r320sc haven't button-->

<card id="start">
<do type="accept" label="next">
  <go href="#two"/>
</do>
<p>this the first card.</p>
</card>

<card id="two">
<do type="accept" label="next">
  <go href="#three"/>
</do>
<onevent type="onenterbackward">
  <go href="#temp"/>
</onevent>
<p>this is the card.</p>
</card>

<card id="three">
<do type="accept" label="back">
  <prev/>
</do>
<p>this is the thired card.</p>
</card>

<card id="temp">
<do type="accept" label="start">
  <go href="#first"/>
</do>
<p>haha, you are lost!</p>
</wml>



分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: