<script>window.onload = function () {
var bot = document.getElementById('bot');
bot.addEventListener('touchstart', function () {
alert('touchstart');
});
creatTouchstartEventAndDispatch(bot);
function creatTouchstartEventAndDispatch (el) {
var event = document.createEvent('Events');
event.initEvent('touchstart', true, true);
el.dispatchEvent(event);
}
}</script>
可以在 onload 后,先用 createEvent 创建模拟事件,再用 dispatchEvent 触发就可以了