问题标签 [jquery-mobile-pageshow]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1260 浏览

javascript - 单击导航栏项时,JQuery Mobile 在页面加载时执行某些操作

我有一个带有一些导航栏的页面,当单击“我的活动”导航栏时,我希望它在加载时执行某些操作,目前出于测试目的,我只是想在加载时提醒屏幕消息,但因为它是一个 js 文件被调用我不确定,要使用什么 Jquery 移动加载功能?

这是我的页面html:

在我的 my_activity.js 文件中,我尝试了不同的页面加载功能。我尝试了以下方法,只有在您手动刷新浏览器时才会触发,当您单击导航栏选项卡时不会触发

0 投票
1 回答
572 浏览

jquery-mobile - Jquery 移动面板无法处理页面重定向和未应用背景图像

我有两个问题。

1)当我在标题后包含面板的 html 代码时,图像不会被应用 2)我有一个按钮,点击后会打开 SocialStream.html 页面,面板(或滑动事件)不起作用当它来自按钮点击时,仅适用于页面刷新。

这是我的 html 页面,带有用于页面加载的 javascript。

0 投票
0 回答
61 浏览

jquery - jQuery mobile - 一页或多页事件?

几乎我的应用程序中的每个页面都有自己的 pageinit 和 pageshow 函数来加载内容和注册事件侦听器。因此,由于我最后有大约 20 个听众,我问自己将它们放在一起是否会更好地提高 jqms 性能,所以使用

代替

每一页?

0 投票
2 回答
1056 浏览

javascript - jQuery Mobile | Navigation between Pages

I am fairly new at JQM and i am trying to build mobile application using jQuery Mobile.

Below is what i am trying to achieve..

I have few HTML pages with each having its own css, javascript and JQM pages. What i need is when i change to another html file and do back on the back button using data-rel="back" i get restored to the previous html file in the state i left it in.

I tried using pagecontainer change function, but it does not load javascript on the new loaded html file. It tried using the following code.

Also i tried another option which was pagecontainer load but this time its not even redirecting. I used the following code.

Is it achievable in JQM.

If Yes then how do i navigate to the other html file so that its javascript and css in the head get loaded. And when i go back using data-rel="back" the previous state is restored.

If No then how do i achieve this. I mean what changes should i make..

Thanks.. Much appreciate any help.

0 投票
1 回答
450 浏览

jquery - 关闭对话框后是否需要取消绑定页面显示事件?

我发现一些有点烦人的东西,并想确保我没有做任何公然错误的事情。我正在使用 jquery-mobile 1.4。

我有一个 mainpage.html,它调用了一个对话框页面.html,它被建模为一个对话框。对话页面有一个 <div data-role="page" id="dialogpage" data-dialog="true">。

dialogpage 也有一个 pageshow 事件附加到 div 页面,如下所示

我发现每次打开此对话框页面时,都会调用一个额外的 pageshow 事件。我的意思是,当我第一次打开对话框时,控制台会打印一次“pageshow dialogpage”。我第二次打开对话框时,它会打印两次。页面的第三次打开打印三次,等等

似乎每次打开页面时都会一次又一次地附加 pageshow 事件。从某种意义上说,这是有道理的,但处理起来似乎很烦人。

我的解决方案是添加一个 unbind 事件,如下所示:

这似乎可以防止“pageshow dialogpage”被多次打印。但这是否意味着我需要取消绑定对话框页面中的所有事件?

难道我做错了什么?

0 投票
1 回答
1839 浏览

javascript - 当应用程序使用 jquery mobile 在科尔多瓦应用程序单页中加载页面时触发事件的最佳方法?

我正在尝试在加载我的应用程序时触发和事件:当应用程序启动时,我会加载#home page 但是如果用户没有被缓存(我使用 kinvey),应用程序应该将页面更改为 #login。我怎样才能做到这一点?

我在 myScript.js 文件的开头尝试了这段代码,并在开头声明了这一点:

我会很感激关于触发什么事件的建议,因为 jquerymobile 文档中有很多,我不知道哪个更方便。

0 投票
1 回答
1654 浏览

events - 移动页面容器:不工作

$(":mobile-pagecontainer")不管用。我必须使用$(document). 下面的代码有什么问题吗?

但它适用于更改页面,如下所示:

谢谢。

0 投票
0 回答
48 浏览

jquery-mobile - 在jquery mobile中向页面添加id

对于 jquery mobile 中的内部链接,我似乎需要为每个页面 div 添加唯一的 id,以便我可以分别处理每个页面。由于页面 div 本身是由 jquery mobile 动态生成的,将动态 id 添加到这些 div 的最佳做法是什么?

编辑:目前我正在请求新页面如下:

nextpage 是一个动态 url。我使用这种方法来允许分页。

0 投票
1 回答
354 浏览

jquery - jQuery mobile header 截断内容

我正在开发一个 jQuery 移动项目,我想在其中使用全屏标题data-position="fixed" data-fullscreen="true"。我遇到的问题是标题正在切入内容。

我试图找出一种方法使内容随着标题的移动而移动。因此,当标题可见时,内容会被向下推,因此不会被截断,而当标题不可见时,内容会被向上推以最小化空白。

据我所知,唯一的方法是margin-top使用 data-role 动态更改 div 的 css 规则content。我认为这很容易,但事实并非如此。

这是我的html:

到目前为止,我已经尝试了以下 jQuery 解决方案,但没有成功:

这两种解决方案都试图捕获标题的高度属性,并且据我所知,设置为的标题data-position="fixed" data-fullscreen="true"始终显示高度为 0。

我见过其他解决方案,例如添加一堆<br/>标签或添加一个空 div。当标题不可见时,这些解决方案都保留空白区域。有谁知道如何根据标题是否可见实际使标题上下切换内容?

0 投票
1 回答
96 浏览

jquery-mobile - jquery mobile加载外部页面,未触发事件

我想转换到外部 jquery 移动页面,但是当调用转换时,没有任何事件被触发:

这是我的 HTML 上的内容:

有没有办法使用任何事件?