addEventListener to iFrame

后端 未结 4 1476
北海茫月
北海茫月 2020-12-18 03:33

I\'m tryin to add event listener to mouseup inside iframe object:

$(\"#myIFrame\").contents().find(\"body\").bind(\"mouseup\", function() {
    //e.preventDe         


        
4条回答
  •  庸人自扰
    2020-12-18 04:22

    $($("#iframeid").contents()[0], window).find('body').bind("mouseup", function(e) {
        alert("works");
    });
    

    Try this. Works in jsfiddle. Enjoy.

提交回复
热议问题