简体   繁体   English

iframe fancybox响应

[英]iframe fancybox responsive

I'd like for my popin to respond in a responsive way horizontally, but not vertically. 我希望我的popin以水平响应的方式响应,但不是垂直响应。 When I use fancybox in order to call img it works, but not when it's for iframe. 当我使用fancybox来调用img时,它可以工作,但不适用于iframe。

Check the difference between my first work and the second. 检查我的第一个作品和第二个作品之间的区别。

I use 我用

<script type="text/javascript">
$(document).ready(function(){
  $('.fancybox').fancybox({
   openEffect: 'elastic',
   closeEffect: 'elastic',
   prevEffect: 'fade',
   nextEffect: 'fade',
   fitToView: true, // 
   maxWidth: "90%", // 
   type: 'iframe',
   scrolling: 'no',
   iframe : {
    scrolling : 'no'
   }
  });
});
</script>

You may actually need to set fitToView to false instead. 您实际上可能需要将fitToView设置为false

$(".fancybox").fancybox({
    fitToView: false, // <-- so it will take your values into account
    // other API options etc.
});

See JSFIDDLE 请参阅JSFIDDLE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM