在DIV容器中,jQuery Mobile的打开链接 [英] Open links in div container in JQuery Mobile

查看:70
本文介绍了在DIV容器中,jQuery Mobile的打开链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多栏布局,其中#内容主要是DIV我想实际的内容加载,和#内容的二次持有环节生成的列表视图(实际上是一个导航菜单)。

i have a multi-column layout where "#content-primary" is the div i want the actual content loaded, and "#content-secondary" holds a generated listview of links(effectively a navigation menu).

我用这个code更改页面,pretty的多继JQM文档,但浏览器下面的链接,以全新的页面,而不是从装载它们的内容纳入#内容主要股利。有明显我丢失的东西。

I'm using this code to change the page, pretty much following the JQM Docs, however the browser is following the links to entirely new pages, instead of loading the content from them into the "#content-primary" div. There's obviously something I'm missing.

$(function(){
            $('#menu a').click(function() {
                $.mobile.changePage($(this).attr('href'), {
                    pageContainer: $("#content-primary")
                } );
            });
        });

在后端使用Django,但它可能是不相关的。

Using Django on the backend, but it probably isn't relevant.

推荐答案

我终于找到了答案的此处。 jQuery Mobile的公司的 changePage()和 loadPage()的方法做过多的后期处理,并触发了很多事件,真正使实现自己的动态加载复杂得多,它应该是。

I finally found an answer here. JQuery Mobile's changePage() and loadPage() methods do too much post-processing and triggers a lot of events that really makes implementing your own dynamic loading more complicated than it should be.

在良好的老式#(#DIV主要内容)的负载(); 的作品,但我仍然在努力JQM样式应用到它。

The good old fashioned #("div#primary-content").load(); works, but I'm still struggling to apply JQM styles to it.

这篇关于在DIV容器中,jQuery Mobile的打开链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆