[]cavans上触发不了input的点击事件
在舞台上添加一个sprite,给sprite添加一个点击事件,this.hitimg.on(Laya.Event.CLICK,this,this.onStart);
onStart:
_proto.onStart = function(){
console.log(111111122222);
$("#fileInput").trigger('click');
}
可以打印数字,但是触发不了input控件。
<input id="fileInput" type="file" accept="image/*" style="display: none;" onchange="filechage(this.files)">
onStart:
_proto.onStart = function(){
console.log(111111122222);
$("#fileInput").trigger('click');
}
可以打印数字,但是触发不了input控件。
<input id="fileInput" type="file" accept="image/*" style="display: none;" onchange="filechage(this.files)">
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
cuixueying
赞同来自:
2. type为file的input不是通过click响应的
建议:
1、input 标签,你先用原生js的方式运行OK,再把js原生实现的代码放进来进行使用
2、LayaAir有自己的input、textInput组件,建议你最好用laya下的组件和事件!