Events Fire Twice in jQueryMobile Application

谁都会走 提交于 2020-01-01 19:54:13

问题


I have a problem with a Phonegap and jQM Application. In that, an event fires twice on Android devices.

To remove the flickering effects I set page transition to 'none'. When I click on the menu button it navigates to page 2. Also, another event fires at the same time on that page.

What is the solution?


回答1:


Paste the below code snippet in the head section of your web page in style tags.This may help.

.ui-page {
    -webkit-backface-visibility: hidden;
} 



回答2:


To resolve triggering of events twice, place pageinit function code in head section of your html page as

<head>
<script type="text/javascript">
..your pageinit function code
</script>
</head>

(or)

Use jquery on() instead of jQuery live() method.



来源:https://stackoverflow.com/questions/16536973/events-fire-twice-in-jquerymobile-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!