开发者

jQuery navigation bar not working in?

开发者 https://www.devze.com 2023-03-17 16:30 出处:网络
In my mobile application, I use navigation bar. and i use beta version 1. <div data-role=\"navbar\" id=\"navibar\">

In my mobile application, I use navigation bar. and i use beta version 1.

<div data-role="navbar" id="navibar">
    <ul>
        <li><a href="#" id="searchNav1">Search</a></li>
        <li><a href="#" id="shoppingNav1">Shopping</a></li>
    </ul>
</div>

JS:

    $('#shoppingNav1').live("click",function() 
{
    alert("in");
    shopping(开发者_StackOverflow);
    $.mobile.changePage("#shoppingListPage","pop", false, false);
    alert("");
});

when i click this it's change the page in my desktop browser but not in actual device


You should pass an object instead of page ID:

$.mobile.changePage($("#shoppingListPage"),"pop", false, false);


'click' binding doesnt work on phone because iphone generate touch events. us 'tap' instead of "click"

0

精彩评论

暂无评论...
验证码 换一张
取 消