How to trigger the iframe element within the parent page

iframe parent page

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

Click the iframe page class

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

js code

$('#face_record').contents().find('.table_img_face').click(function(){
                var img_url = $(this).attr('src')
                $('.pop_img').children('img').attr('src',img_url)
                $('.bounced').show();
            })

Guess you like

Origin www.cnblogs.com/menxiaojin/p/12085068.html