Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ios6";翻译;方法干扰?_Javascript_Ios6 - Fatal编程技术网

Javascript ios6";翻译;方法干扰?

Javascript ios6";翻译;方法干扰?,javascript,ios6,Javascript,Ios6,为什么下面的代码在ios6上不起作用,但是用“something_other”替换“translate”就可以了 <style> .body{position:absolute;top:0px;left:0px;right:0px;bottom:0px;z-index:2;} </style> <div class="body"></div> <script language="javascript"> var add_

为什么下面的代码在ios6上不起作用,但是用“something_other”替换“translate”就可以了

<style>
    .body{position:absolute;top:0px;left:0px;right:0px;bottom:0px;z-index:2;}
</style>
<div class="body"></div>
<script language="javascript">
    var add_output = function(html,parent){
        parent.insertAdjacentHTML('afterbegin',html)
        return parent.childNodes[0];
    }
    var new_output = add_output('<div style="position:absolute;top:10px;left:10px;z-            index:1;" class="new_output">0</div>',document.body);
    new_output.translate = function(d){
        this.innerHTML = d;
    }
    document.querySelector('.body').addEventListener('touchmove',function(e){
        e.preventDefault();
        new_output.translate(e.touches[0].pageX);
    });
</script>

.body{位置:绝对;顶部:0px;左侧:0px;右侧:0px;底部:0px;z索引:2;}
var add_output=函数(html,父级){
parent.insertAdjacentHTML('afterbegin',html)
返回parent.childNodes[0];
}
var new_output=add_output('0',document.body);
new_output.translate=函数(d){
this.innerHTML=d;
}
document.querySelector('.body').addEventListener('touchmove',函数(e){
e、 预防默认值();
新建_output.translate(e.touchs[0].pageX);
});
HTML5中添加了一个新属性。您只是将其设置为
true
,因为所有对象的计算结果都是
true