更新 chrome 版本 43.0.2357.65 m 后,弹出窗口在 JQueryMobile 1.3.2 中失败 [英] Popups fail in JQueryMobile 1.3.2 after update chrome version 43.0.2357.65 m

查看:19
本文介绍了更新 chrome 版本 43.0.2357.65 m 后,弹出窗口在 JQueryMobile 1.3.2 中失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最新的 chrome 版本43.0.2357.65 m"是否为其他人破坏了 JQueryMobile 1.3.2?当我现在单击一个弹出窗口时,它会转到页面顶部并且滚动条消失.以前的版本没问题.

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.

该问题影响了我的应用程序,但可以在 JQueryMobile 演示页面上重现:

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

  1. 使用 Chrome 43.0.2357.65 米转至 http://demos.jquerymobile.com/1.3.2/
  2. 点击弹出窗口
  3. 在弹出页面上,点击页面中间的登录"按钮.
  4. 它将转到页面顶部,滚动条将消失.

请注意,这不会每次都发生 - 如果您再试一次,它可能会起作用,但如果您从新选项卡开始执行这些步骤,它似乎会始终如一地发生.

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.

我向 Chrome 提出了一个问题,但只是想知道是否有人知道发生了什么以及是否有我可以实施的解决方法.

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.

谢谢!

推荐答案

弹出窗口似乎很奇怪很难复制 -转到下面的确切链接,然后单击所说的登录"按钮似乎可以保证行为.http://demos.jquerymobile.com/1.3.2/widgets/popup/#&ui-state=dialog

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

使用下面的代码片段覆盖有问题的函数.你必须在加载 jquerymobile js 之前调用它

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);
       }
     };

   })

背景:jqueryMobile 1.3.2 实现 jquery one() 事件处理程序附件有些不正确.

Background: jqueryMobile 1.3.2 implements the jquery one() event handler attachment somewhat incorrectly.

.one() - 将处理程序附加到元素的事件.处理程序每个事件类型的每个元素至多执行一次.":http://api.jquery.com/category/events/ :本质上是事件触发然后被删除.

.one() - "Attach a handler to an event for the elements. The handler is executed at most once per element per event type." : http://api.jquery.com/category/events/ : essentially event fires and then is removed.

但是,使用 one() 调用 ("webkitAnimationEnd and animationend") 可能意味着两个处理程序中只有 1 个(取决于浏览器)被触发离开另一个太逗留并可能导致内存泄漏.

However calling both ("webkitAnimationEnd and animationend") using one() would potentially mean that only 1 (depending on browser) of the two handlers is ever fired leaving the other too linger and potentially cause memory leaks.

Chrome43 处理 webkitAniationEnd 和 animationend - 但在任何给定时间只有一个.这让另一个在元素上的下一次动画发生时逗留并触发.

Chrome43 handles both webkitAniationEnd and animationend - however only one at any given time. This leaves the other to linger and fire off the next time animation on the element occurs.

这篇关于更新 chrome 版本 43.0.2357.65 m 后,弹出窗口在 JQueryMobile 1.3.2 中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆