jQuery   发布时间:2022-04-19  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Jquery移动更改页面大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有从网站的网页的两列布局,
http://jquerymobile.com/demos/1.0.1/

现在他们已经规定了changePage使用
< a href =“#xxx”data-role =“button”>示例< / a>

但是我的问题是如何使用代码来编程改变页面

$ .mobile.changePage(“#xxx”); isnt为我工作

解决方法@H_419_12@
这里是一个真正的简单例子: http://jsfiddle.net/shanabus/YjsPD/
$.mobile.changePage("#page2");

文档:http://api.jquerymobile.com/jQuery.mobile.changePage/

其他示例:

//transition to the "about us" page with a slideup transition
$.mobile.changePage( "about/us.html",{ transition: "slideup"} );

//transition to the "search results" page,using data from a form with an ID of "search""   
$.mobile.changePage( "searchresults.PHP",{
    type: "post",data: $("form#search").serialize()
});

//transition to the "confirm" page with a "pop" transition without tracking it in history   
$.mobile.changePage( "../alerts/confirm.html",{
    transition: "pop",reverse: false,changeHash: false
});

更新

正如Chase Roberts在下面的注释中指出的,这个changePage方法在1.4版本中已被弃用。这是新的pagecontainer change事件的文档。

例:

$.mobile.pageContainer.pagecontainer("change","#page",{ options });

这也是关于这个问题的答复:how to change page in latest jquery mobile (1.4 beta)?

大佬总结

以上是大佬教程为你收集整理的Jquery移动更改页面全部内容,希望文章能够帮你解决Jquery移动更改页面所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。