changePage “jumps” back to old page

后端 未结 6 2014
长情又很酷
长情又很酷 2020-12-15 18:47

I\'ve a big problem with a jQuery Mobile Application: I\'m using custom functions (they are triggered by onClick) to switch the page with currentPage.

It only happen

6条回答
  •  无人及你
    2020-12-15 19:12

    Would you try to add the event stopPropagation and preventDefault methods on the first page's click event? This way the default action of the click event will not be triggered. Moreover the stopPropagation prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.

    • event.stopPropagation();
    • event.preventDefault();

    Example:

    $("p").click(function(event){
        event.stopPropagation();
        event.preventDefault();
        // change page
    });
    

提交回复
热议问题