How catch iframe resize event from inside the iframe (iframe and the page - same domain)

后端 未结 3 1176
温柔的废话
温柔的废话 2021-01-18 07:31

I try to listen from inside of iframe to changes of iframe width/height with:

$(window).resize(function(){
    alert(\'1 on inside iframe\');
});
         


        
3条回答
  •  醉话见心
    2021-01-18 08:26

    You need to call the resize() handler from the parent document on the iframe:

    $('iframe').resize(function() {} );
    

提交回复
热议问题