-
Notifications
You must be signed in to change notification settings - Fork 29
PKUI.CORE.applyTouchListeners
kerrishotts edited this page Nov 14, 2012
·
1 revision
(part of PKUI.CORE)
Return Type: void
Parameters: none
Iterates through all button
s and a
s and adds touchstart
and touchend
event handlers to them in order to allow handling of the touched
class.
When one of the elements receives a touchstart
event, the touched
class will be added. When the touchend
is received, the touched
class will be removed. This lets us target styles for touched elements, much like we might for hovered or active elements on the desktop.
Example:
PKUI.CORE.applyTouchListeners();
- Will only apply listeners to elements that have not previously received listeners. An attribute is attached to those elements that have received elements so that they aren't touched again.
- Normally called every 100ms so that changes in the DOM are automatically handled. If the DOM is quite large, however, it is possible that this will have a negative performance impact on the app. In that case, PKUI.CORE.listenerInterval should be set to
0
in theframework.ui-core.js
file and then this method should be called manually after any DOM change that might need touch listeners applied.
0.1 Introduced
0.2 Docs Valid