Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
391 views
in Technique[技术] by (71.8m points)

javascript - Popups fail in JQueryMobile 1.3.2 after update chrome version 43.0.2357.65 m

Has the latest chrome version "43.0.2357.65 m" broken JQueryMobile 1.3.2 for anyone else? When I click a popup now it goes to the top of the page and the scroll bar dissapears. It was fine in previous version.

The problem is affecting my applicaiton but is reproduceable on the JQueryMobile demo pages:

  1. Using Chrome 43.0.2357.65 m go to http://demos.jquerymobile.com/1.3.2/
  2. Click on popup
  3. On the popup page click on "Sign in" button halfway down the page.
  4. It will go to the top of the page and the scrollbar will have disappeared.

Note this doesn't happen every time - if you try it again it might work, but if you start the steps from a fresh tab it does appear to happen consistently.

I've raised an issue with Chrome but just wondering if anyone knows what's happening and if there's a workaround I can implement.

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The popup seems to be odd it's hard to replicate - Going to the exact link below and then clicking on the said "sign in" button seems to guarantee the behaviour. http://demos.jquerymobile.com/1.3.2/widgets/popup/#&ui-state=dialog

I believe the solution below may be related it fixes other fun issues with the slide transition. (only limited test with popup) but looks promising

Overriding the offending function with code snippet below. You have to call this before you load jquerymobile js

// Override of $.fn.animationComplete muse be called before initialise jquery mobile js
   $(document).bind('mobileinit', function() {
     $.fn.animationComplete = function(callback) {
       if ($.support.cssTransitions) {
         var superfy= "WebKitTransitionEvent" in window ? "webkitAnimationEnd" : "animationend";
         return $(this).one(superfy, callback);
       } else {

         setTimeout(callback, 0);
         return $(this);
       }
     };

   })

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...