jquery-mobile

How do I update the position of a jQuery Mobile global popup?

不羁的心 提交于 2019-12-13 02:48:22
问题 I have a jQuery Mobile global popup, whose contents are generated dynamically. So by default it's empty. I'm listening for the beforeposition event to capture the popup being opened. Then I load a config file/content file, generate the content and append it to the popup. However by the time I'm appending, JQM is already done calculating the position of the popup so it will be misplaced on the screen. Here is what I'm doing: $(document).find("#global-popup") .on("popupbeforeposition", function

jQuery Navbar “persistent toolbars” doesn't work even simple example - what do I do wrong?

泄露秘密 提交于 2019-12-13 02:26:23
问题 I'm trying to implement navbar "persistent toolbars" so that I need to define the navigation bar once. ref: http://jquerymobile.com/demos/1.2.0/docs/toolbars/footer-persist-a.html (you need to define data-id="the same" on each page) First I put straight into my development, did no work and as I see it does not seem to work with simple cases either, I tried all kind of combinations. What can be wrong width the following code ? Navivagtion leads to the second page but not toolbar there. CODE:

Cannot show Popup with jQuery Mobile 1.3.1

一世执手 提交于 2019-12-13 02:23:27
问题 I'm trying to pop up a very simple "are you sure?" popup in jQuery Mobile. But if I use the data-rel="popup" on the button, nothing happens. If I remove the data-rel it opens - but as a full window. The logic works well, but still, I'd like to see a popup. Here's the code (simplified - I removed the other pages, the header, html etc. - the app works well other than this issue, so no need to debug those). The 2 elements to look at are the button "clearHistory" and the popup itself "history": <

jQuery mobile: Meaningful URL for a dialog page?

走远了吗. 提交于 2019-12-13 02:23:19
问题 Is it possible to link to a dialog, and have it display as a dialog? In other words: Open a dialog from an underlying page Bookmark the URL Open a new browser tab Paste the URL Have the dialog open up in front of its underlying page I can't see how to link to the dialogs in the jQuery Mobile demo (or here) - if I copy the URLs, and reopen them, the underlying page opens but not the dialog. 回答1: All you have to do is specify on your link that it should open the target as a dialog. In the

Create a generic class to bind knockout object with pages

拥有回忆 提交于 2019-12-13 02:20:00
问题 I am bit new to knockout and jquery mobile, There was a question which is already answered, I need to optimize the PageStateManager class to use generic bindings, currently PageStateManager can only use for one binding,I would really appreciate if someone can guide me to create a generic class to manage page states with knockout bindings Heere is the working code,http://jsfiddle.net/Hpyca/14/ PageStateManager = (function () { var viewModel = { selectedHospital: ko.observable() }; var

How to access the database using WebSQL?

可紊 提交于 2019-12-13 02:19:30
问题 I'm develop a web app and I have an existing database.I'm trying to getting the data from database using WebSQL but getting error as "ExceptionReferenceError: tx is not defined " code: var databaseSync = null; try { databaseSync = openDatabase("database", "1.0", "Database", 10 * 1024 * 1024); databaseSync.transaction(function(tx){ tx.executeSql('SELECT distinct(Subject) FROM Data', [], function (tx, cb_results){ var len = cb_results.rows.length; var results = []; for (i = 0; i < len; i++) {

Close button on dialog returns to the wrong page

旧街凉风 提交于 2019-12-13 02:19:26
问题 Here's a very simple fiddle: http://jsfiddle.net/mmSKj/ If you click the "presets" button in the header bar, it opens a dialog. If you click the "close" button on the dialog, instead of going back to the page it came from, it goes to the last page (excluding the dialog itself) on the page (the one with the content This is another page ). How come? Is there a way to fix the automatically inserted back button so it behaves itself properly (like the "home" button I included in the dialog) or,

how to refresh(reload) page when click button in Jquery mobile

徘徊边缘 提交于 2019-12-13 02:12:47
问题 I'm using Jquery mobile v1.4, how to refresh(reload) page when click button ? Also which one is loads faster between refresh/reload ? <a href='#' class='btnRefresh'>Refresh</a> 回答1: You can try some thing like this Call the given JS function on click of your anchor tag function refreshPage() { $.mobile.changePage( window.location.href, { allowSamePageTransition : true, transition : 'none', showLoadMsg : false, reloadPage : true } ); } for more detail click here I hope this helps you! 回答2: try

how to disable jQuery.Mobile.MVC?

◇◆丶佛笑我妖孽 提交于 2019-12-13 02:06:48
问题 I building a mobile views for my website and i am still in process of creating them. i want to test how it would look on live device. so i would like to disable the .mobile files and below i tired running some scripts to disable but no luck. <script>$(function () { $('html').find('*').attr('data-role', 'none'); }); </script> <script>$(document).ready(function () { // disable ajax nav $.mobile.ajaxEnabled = false; }); </script> Maybe these is a question for the developers but if any one can