jquery-mobile

Creating iOS page indicator (dots) with jQuery Mobile

独自空忆成欢 提交于 2019-12-12 08:09:51
问题 // my Question to the lovely lady in the corner I would like to create a pagination for indicating what page is visible, like in iOS, (those little dots below a window, known as "page indicators" in the HIG.) -- My project is hereby referred to as, Her Highness. I found an example, but I can't find documentation on re-creating the layout, and it's in the experiment section :( http://jquerymobile.com/test/experiments/scrollview/#../../docs/toolbars/footer-persist-a.html 回答1: I'm not sure why

Append <li> element to <ul> and add click event for each?

主宰稳场 提交于 2019-12-12 08:08:36
问题 I'd like to add a series of <li> elements to a <ul> , and add a click event to each one, programmatically. I'm not sure how to do this, at least not in a neat, jQueryish way. This is my existing code: <ul id="saved-list"></ul> <script type="text/javascript"> $.each(all_objects, function() {{ var list_route = "<li><a href='#saved-route'>" + this.text + "</a></li>"; $('#saved-list').append(list_route); // add unique id (this.id) to item and click event here? // pseudocode - onclick: alert(this

jQuery UI draggable prevents scrolling on mobile

拈花ヽ惹草 提交于 2019-12-12 08:04:16
问题 I have draggable elements with full screen width listed vertically. I am using a plugin called (jquery.ui.touch-punch) to enable jQuery draggable on mobile. But the problem is that the draggable elements prevent the user from scrolling the page. $('#novieList .element .content').draggable({ axis: 'x', revert: function() { return $(this).position().left < 30; }, containment: [ 0, 0, 75, 0 ], scope: 'element', scroll: false, delay: 300, drag: function(event, ui) { return true; }, start:

swipeleft/swiperight triggered during vertical scroll in jQuery mobile

强颜欢笑 提交于 2019-12-12 08:03:05
问题 Problem is that swipeleft/swiperight event is trigger when I want vertical scroll. We are using jQuery mobile 1.1.0 version and jQuery 1.7.1. and code is: $(document).delegate('#quizResumePage', 'swipeleft swiperight', function (event) { event.stopImmediatePropagation(); if (event.type == 'swipeleft') { $('#btnnext').trigger('click'); } else if (event.type == 'swiperight') { $('#btnprevious').trigger('click'); } event.preventDefault(); }); Then why swipe event trigger when I want to scroll

How to navigate back one page using $.mobile.changePage

只谈情不闲聊 提交于 2019-12-12 07:33:23
问题 All of the JQuery Mobile documentation I can find about navigating backwards assumes I am going to do this using an anchor tag and suggest I add data-rel="back" to the tag. I'm not navigating from a tag, I'm mixing with PhoneGap which means I'm calling javascript functions like PhoneGap.something(goForwardOnSuccess,goBackwardsOnFailure); where function goFowardOnSuccess() { $.mobile.changePage('#next', { transition: 'pop' }); } function goBackwardOnFailure() { $.mobile.changePage(/* I HAVE NO

How to show datepicker on field focus only?

你说的曾经没有我的故事 提交于 2019-12-12 06:57:33
问题 I'm adding jquery mobile date picker but it shows the date picker by default. Instead, I want it to show up only on focus and to be hidden when the field loses focus...Any idea how ? In the page header I added <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" /> <link rel="stylesheet" href="/css/jquery.ui.datepicker.mobile.css" /> <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> <script> //reset type=date inputs to text $( document

Jquery mobile ''pagebeforeshow' not executing after pressing back

落花浮王杯 提交于 2019-12-12 06:57:02
问题 i have implemented some logic inside $(document).on('pagebeforeshow', '#mainPage', function(){ } but it doesnt load when a user eitehr presses the back key to go back to this specific page containg this JS or when calling history.back(-1); return false; to manually go back to the previous page. It only gets executed if you do a refresh or directly go to the page using a href<> Any sugestions? cheers 回答1: Since you're using multi-files template, you need to fetch previous URL from history

button relative position changes after screen resize

£可爱£侵袭症+ 提交于 2019-12-12 06:48:12
问题 I have a button positioned in the lower right corner of a page. My problem is 1) Firefox seems to place the button in a different position than Chrome or IE9, and 2) the relative position of the button changes when I resize the screen after the initial load. I found a hack on SO that seems to help the FF problem (see code)...but I am still having the issue of the button reposition after the initial page load. In all 3 browsers, the button is placed perhaps 15 pixels higher (away from the

Force refresh an image in jquery mobile

ぐ巨炮叔叔 提交于 2019-12-12 06:47:25
问题 Android, Phonegap, jqm 1.4 When a user uploads a new profile pic in my app, it changes on the server, but since the img src is the same path (same path, new data), it doesn't update in the app (page refresh, building a new image element, etc.) I have to restart the app for the changes to take place. Is there a way to refresh just the image elements so they will redownload the image? I suppose it's cacheing the image... I'd like to keep cacheing in general, but just "un-cache" when a user

AngularJS and Jquery: angular dosen't bind on jquery navigation

淺唱寂寞╮ 提交于 2019-12-12 06:47:03
问题 Jquery is ignoring all Angular ng binds(ng-app,ng-controller,ng-bind..) on page change.They are working in index but when I navigate to other pages ng-s just aren't working.Is there a way to "rebind" angular when page dynamically changes? in first html: <section data-role="page" ng-app="aki" ng-controller="akicontroller"> <a href="sec.html"></a> </section> in second html ng-app and ng-controller are ignored: <section data-role="page" ng-app="aki" ng-controller="akicontroller"> </section>