Grandstream GXV3140 GMI Guide User Manual
Page 19

Grandstream Networks, Inc.
GMI HTML SDK and API Guide
Page 19 of 43
www.grandstream.com
Last Updated: 09/2010
Refer to the code and the comments below for the implementation of the Menu Example:
File:index.html
/******************************************************************************
* After the page loads, the first item will be highlighted. At the same time, all the
keypad events are handled by softkey_process(keyCode).
。softkey_process has mapped F1/Enter button to “Select” to load the url of the
selected item. F2 is mapped to the API function call GMIEngine.refresh() to refresh
the current page, F4 is mapped to the API function call GMIEngine.exit() to exit the
application.
* The GMI App will process the up/down button keystroke and locate the item
selected.
(Here, up/down/left/right button is not mapped to tab, the items are located
through an array )
******************************************************************************/
<
body
onload="init
()
;"
onkeydown="softkey_process
(
event
.keyCode
)
;"
id
=
"body"
>
<
table
id
=
"main"
>
<
tr
width
=
"100%"
>
<
td
width
=
"20%"
>
/******************************************************************************
*
Defines a menu item and change the button background when
mouseover/hover/focus.
******************************************************************************/
<
button
class
=
"menu"
id
=
"b_call_0"
onmouseover="chang_to_gif
(
document
.
getElementById
(
'i_call_1'
))
;"
onfocus="chang_to_gif
(
document
.getElementById
(
'i_
call_1'
))
;"
onmouseout="chang_to_png
(
document
.getElementById
(
'i_call_1'
))
"
onb
lur="chang_to_png
(
document
.getElementById
(
'i_call_1'
))
;"
>
<
table
class
=
"item_tab"
>
<
tr
class
=
"item_tr"
>
<
td
align
=
"center"
><
img
id
=
"i_call_1"
src
=
"img/call.png"
/>
td
>
tr
>
<
tr
><
td
align
=
"center"
><
font
class
=
"item_label"
>
Call
font
>
td
>
tr
>
table
>
button
>
td
>
<
td
width
=
"20%"
>
<
button
class
=
"menu"
id
=
"b_call_1"
onmouseover="chang_to_gif
(
document
.
getElementById
(
'i_ticket_1'
))
;"
onfocus="chang_to_gif
(
document
.getElementById
(
'
i_ticket_1'
))
;"
onmouseout="chang_to_png
(
document
.getElementById
(
'i_ticket_1'
))