Question

I'd like for my popin to respond in a responsive way horizontally, but not vertically. When I use fancybox in order to call img it works, but not when it's for 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>
Was it helpful?

Solution

You may actually need to set fitToView to false instead.

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

See JSFIDDLE

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top