App Framework框架之绑定事件(1)

阅读更多

App Framework是intel公司开发的一个web app框架

官网:http://app-framework-software.intel.com/af22

有如下事件:

tap                  Tap on the element

singleTap            Single tap on the elem (250ms delay after tap is triggered)

doubleTap            Double tap (quick) on the element

longTap              Long press on the element

swipe                The element was swiped (30px threshold)

swipeLeft            The element was swiped left

swipeRight           The element was swiped right

swipeUp              The element was swiped up

swipeDown            The element was swiped down

 

绑定事件

 

$("#element").bind("doubleTap",function(){});

$('#label_toggle_passwd').bind("tap",function(){
    toggleCheckbox(document.getElementById('showpw'));
})

 App Framework UI  基于ZeptoJS*触屏库提供了多种触屏事件  ,以下是你可以注册监听的事件列表

 

tap //类似于普通的 click

singleTap //点一次

doubleTap //连续点两次

longTap //长按

swipe //滑屏

swipeLeft //左滑屏

swipeRight //右滑屏

swipeUp //上滑屏

swipeDown //下滑屏

The swipe event is always triggered with the direction of the swipe. The tap event is always triggered when singleTap, doubleTap or longTap are dispatched.

 

Events

Below are the following events triggered in App Framework UI. 

1
$.ui.load - This event is fired once when
App Framework UI is loaded and ready to go.

These events are only triggered on the window object

1
2
3
hashchange - This event is fired when the a panel has been changed.
orientationchange - This event is fired when the page rotates.
afui:init - This event fires when then $.ui object has been initialized

These events are triggered on the document.

1
2
afui:ready - App Framework UI has launched and ready to be used
missingpanel - This event is fired when the panel was not found in the DOM

These events are triggered on a DOM node. They will bubble up.

1
2
3
4
5
6
7
unloadpanel  - This event is fired when a panel has been unloaded.
loadpanel  - This event is fired when a panel has been loaded.
tap  - This event is fired when tap event happened on a node.  It is similar to a click event.
doubleTap  - This event is firedd when a DOM node is double tapped.
singleTap  - This event is fired when a node is single tapped.  There is a delayed trigger for this event.
longTap  - This event is fired when a user holds down a tapped a node for over 750 milliseconds.
swipe - This event is fired when a user swipes a DOM node.

These events are triggered by a scroller object. These events are handled using $.trigger and $.bind. These events will not bubble.

1
2
3
4
5
6
7
8
9
10
11
12
refresh-release  - This event is fired when a scroller object pull to refresh has been released.
refresh-cancel - This event is fired when a refresh has been triggered, but a user scrolls then we cancel it.
refresh-trigger - This event is fired when a refresh request has happened on the scroller.
refresh-finish - This event is fired when a refresh has been processed and finished.
 
infinite-scroll - This event is fired  when a scroller has hit the end of the content and is requesting more info.
infinite-scroll-end - This event is fired when a scroller has stopped scrolling after triggering an infinit-scroll event.
 
scrollstart - This event is fired when a scroller object starts scrolling.
scrollend - This event is fired when a scroller stops scrolling.
 
swipeLeft/swipeRight/swipeDown/swipeUp - These events are fired in response to a swipe event.  They indicate the direction of the swipe.

你可能感兴趣的:(App,Framework,UI,web,app)