jquery-mobile

jQuery Mobile - can't bind pagebeforechange to page id?

早过忘川 提交于 2019-12-31 20:18:26
问题 I could only ever bind pagebeforechange to the entire jquery mobile document, not an individual page. Can anyone explain why this doesn't work? 回答1: $("div[data-role='page']").live( "pagebeforehide", function( event ) { alert('This alert should trigger before Next Page Here is shown?'); }); (check the link for details) you can also use bind instead of live , Hope it helped. 回答2: Selector for JQM pages: $('.ui-page') Adding the event listener to all the pages in the document can be done as: $

Mobile gestures in backbone.js

浪尽此生 提交于 2019-12-31 18:02:23
问题 Can I have mobile gestures like swipe, tap, pinch etc in the Backbone.js View events? To be more specific following is my code. Backbone.View.extend({ initialize:function(){ //initialization }, Events:{ "swipe-left #homeBtn":"homeSwipe" }, homeSwipe:function(){ alert("Event Swipe left triggered!"); } }); Can I have the mobile gestures like swipe, swipe-left/right, pinch, tap etc to work with backbone.js? 回答1: Backbone relies on jQuery.bind to manage the DOM events. So the question is that if

Mobile gestures in backbone.js

痴心易碎 提交于 2019-12-31 18:01:05
问题 Can I have mobile gestures like swipe, tap, pinch etc in the Backbone.js View events? To be more specific following is my code. Backbone.View.extend({ initialize:function(){ //initialization }, Events:{ "swipe-left #homeBtn":"homeSwipe" }, homeSwipe:function(){ alert("Event Swipe left triggered!"); } }); Can I have the mobile gestures like swipe, swipe-left/right, pinch, tap etc to work with backbone.js? 回答1: Backbone relies on jQuery.bind to manage the DOM events. So the question is that if

how to add full screen welcome image on a web app using jquerymobile

孤人 提交于 2019-12-31 08:39:51
问题 I think it's there in jQTouch but how do I add a full screen welcome image for my iPhone web app developed using jQueryMobile? The app is a full screen web app and it is already added in the iPhone Homescreen. 回答1: This is just a concept but you could try something like this: Live Example: http://jsfiddle.net/yzvWy/14/ JS $(function() { setTimeout(hideSplash, 2000); }); function hideSplash() { $.mobile.changePage("#home", "fade"); } HTML <div data-role="page" data-theme="b" id="splash" style=

Get param value from a URL in jquery mobile

China☆狼群 提交于 2019-12-31 07:26:28
问题 I have got a page called servicesDetails.html that has links.The url looks like below ../Myapp/servicesDetails.html?servicetype=Advanced&serviceid=1208 The links when clicked loads an internal page called audioListPage with some params,the link looks like this <a href="#audioListPage?audioid=123&audiotype=mp3" class="loadAudio" data-role="button" data-mini="true" data-inline="true"> Once the audioListPage is loaded the url changes to ../Myapp/servicesDetails.html?servicetype=Advanced

JQuery-mobile : Load JQPlot graph through AJAX request

拟墨画扇 提交于 2019-12-31 07:10:14
问题 I am new on JQuery Mobile and I am trying to display a page with a JqPlot graphic depending on the user choice. I read and experimented this morning that by design the javascript code of a page displayed/loaded by clicking on a link is not executed. To taking into account JS script of a page to load, the data attribute data-ajax of the link must be set to false. But in this case, the browser reload all the page and the is no smooth transition for the user. <p><a href="myUrl.php" data-ajax=

How to pass button text to another page?

我们两清 提交于 2019-12-31 06:59:08
问题 I'm making an app for the BlackBerry PlayBook using jQuery Mobile, and in a page (actually a div with data-role='page' ), I've got a lot of (say, 125) buttons each with a unique text. I've used the a tag with data-role='page' for this. There's a separate page like the above, but with different content in the same HTML file. The content in this page depends on the button clicked in the page 1. So my question is, how can I load the page 2, along with the associated content, according to the

JQuery Mobile: Adjusting Width and Height of Grouped Select

余生长醉 提交于 2019-12-31 06:41:06
问题 I had a problem before positioning grouped select but fortunately been fixed. now I am having problems with resizing, adjusting width/height of the grouped select. If there is anyone who can help me I will greatly appreciate it. below is my code... this is my code to position it on the screen, even if i add width and height to this it seems like it is not updating. I also noticed that the width changes based on the length of the selected item. eg is when i select "September" the width of the

How do I get the value of a select menu with jquery on change

*爱你&永不变心* 提交于 2019-12-31 06:22:10
问题 I have a select menu that i'm trying to bind a click function and be able to get the select options value attribute back on change. select = $('#select_networks').selectmenu(); //bind the change of network/group select.bind( "change", function(event, ui) { //need to figure out the selected elements value attribute }); 回答1: See this: $("#select_networks").bind("change", function() { alert($(this).val()); }); UPDATE $("#select_networks").bind("change", function() { var typeVal = $(this)

How do I get the value of a select menu with jquery on change

↘锁芯ラ 提交于 2019-12-31 06:20:10
问题 I have a select menu that i'm trying to bind a click function and be able to get the select options value attribute back on change. select = $('#select_networks').selectmenu(); //bind the change of network/group select.bind( "change", function(event, ui) { //need to figure out the selected elements value attribute }); 回答1: See this: $("#select_networks").bind("change", function() { alert($(this).val()); }); UPDATE $("#select_networks").bind("change", function() { var typeVal = $(this)