如何在父页面内触发iframe的元素

父页面的iframe

<iframe src="{{ url_for('room_info.person_open_record', resiId =resiId) }}" style="width: 100%;" id="face_record"></iframe>

iframe页面的点击的class

<img src="{{ i.imgUrl }}" class="table_img_face"/>

js代码

$('#face_record').on('load',function(event){
                $('#face_record').contents().find('.table_img_face').on('click',function(){
                    var img_url = $(this).attr('src')
                    $('.pop_img').children('img').attr('src',img_url)
                    $('.bounced').show();
                });
            }); 
posted @ 2019-12-23 17:45  星宝攸宁  阅读(477)  评论(0)    收藏  举报