ilh*_*han 4 javascript google-chrome extjs sencha-touch
我使用Sencha Touch 1.1.1
昨天谷歌浏览器更新到39时,它已经开始出现此错误
Uncaught ReferenceError: WebKitPoint is not defined
Run Code Online (Sandbox Code Playgroud)
因为他们已经删除了WebKitPoint.Sencha Touch的代码是WebKitPoint,位于第6行http://cdn.sencha.io/touch/sencha-touch-1.1.1/sencha-touch.js.是的.
getXY: function() {
var a = window.webkitConvertPointFromNodeToPage(this.dom, new WebKitPoint(0, 0));
return [a.x, a.y]
}
Run Code Online (Sandbox Code Playgroud)
我认为WebKitPoint是某种函数对象{x:0,y:0}但我无法创建/创建JavaScript代码所需的东西; 我写了这个,WebKitPoint = {x:0, y:0}
但它又给出了错误,这一次说它不是一个函数.
我也发现了这个:https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/pIbpN_8Lqpg
tl;博士谷歌Chrome 39不再支持WebKitPoin.我该如何模仿或替换它?
Ahm*_*mad 13
你可以尝试更换
var point = window.webkitConvertPointFromNodeToPage(this.dom, new WebKitPoint(0, 0));
return [point.x, point.y]
Run Code Online (Sandbox Code Playgroud)
同
var rect = this.dom.getBoundingClientRect();
return [rect.left, rect.top];
Run Code Online (Sandbox Code Playgroud)
资料来源:https://code.google.com/p/chromium/issues/detail?id = 434976#c10
代码信誉:PhilipJägenstedt
归档时间: |
|
查看次数: |
4714 次 |
最近记录: |