Skip to content

Commit 5ca6d8c

Browse files
committed
fix #643, when element has no style attribute
1 parent 1cab23e commit 5ca6d8c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/manager.js

+3
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ Manager.prototype = {
262262
*/
263263
function toggleCssProps(manager, add) {
264264
var element = manager.element;
265+
if(!element.style) {
266+
return;
267+
}
265268
each(manager.options.cssProps, function(value, name) {
266269
element.style[prefixed(element.style, name)] = add ? value : '';
267270
});

src/touchaction.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ TouchAction.prototype = {
3232
value = this.compute();
3333
}
3434

35-
if (NATIVE_TOUCH_ACTION) {
35+
if (NATIVE_TOUCH_ACTION && this.manager.element.style) {
3636
this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
3737
}
3838
this.actions = value.toLowerCase().trim();

0 commit comments

Comments
 (0)