开发者

jquery mobile changePage not fully working

I am trying to load page dynamically in jquery mobile by calling IM.bindClick() function, defined below. Well, it is not a complete one because it always open test1.html

Everything looks good in Safari (except that after running a few times, the back button will move to the "back" page, and continue by itself to current page).

In iPhone emulator, it seems worse ~ since above mentioned problem will observe rig开发者_开发问答ht away. And on top of it, the "clicked" link was stuck in "highlighted" background color (i.e. blue background and white font) always, once clicked.

Is there anything wrong with below code?

IM.bindClick = function(page){
    jQuery('#'+ page +' div[data-role=content] a').bind('click', function(e) {
    var hyperlink = "/docs/test.html";
    IM.mobile.changePage(IM.ROOT + hyperlink, "pop");
    e.stopPropagation();
    return false;
});
}

Let me know if you have better idea..

Thanks, iwan


sorry, it was my fault to call bindClick multiple times. as for the sticky CSS, it is an existing jqm bug -- workaround is to rebuild the link while showing the page or remove the css using jquery upon page is hidden

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜