为什么以下内容对ios6不起作用,但将“translate”替换为“something_else”会使其正常工作?
<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>