예를 들어이 URL이 있습니다.
<a data-fancybox data-type="iframe" data-src="/webrtcv2/" href="javascript:;"><i class="fa fa-video-camera" aria-hidden="true"></i></a>
일반적으로 URL을 iframe으로 표시하지만 iframe 내부가 아닌 iframe 에이 추가 div 콘텐츠를 추가해야합니다.
<div id="video-content" class="video-link" >
<a id="iframelink" class="link-id-videochat" href="">Send invitation</a>
</div>
이것은 내 fancybox 3 코드입니다.
$(document).ready(function(){
$('[data-fancybox="iframe"]').fancybox({
toolbar : false,
smallBtn : true,
iframe : {
preload : true
}
})
});
가장 간단한 해결책은 afterLoad
콜백 을 사용 하여 콘텐츠 영역 내에 양식을 복제하고 추가하는 것입니다. 예 :
JS
$("#test").fancybox({
afterLoad : function(instance, current) {
current.$content.append( $('#video-content').clone(true).show());
}
})
CSS
.fancybox-slide--iframe .fancybox-content {
max-width: 500px;
max-height: 200px;
}
#video-content {
position: absolute;
top: calc(100% + 20px);
background: #fff;
left: 0;
right: 0;
padding: 5px;
text-align: center;
}
데모-https: //jsfiddle.net/18hbr7oe/
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다