Fancybox PDF not working in Chrome. Not sized properly on iPad.

868 views
Skip to first unread message

Myles Lam

unread,
Apr 27, 2013, 4:13:05 PM4/27/13
to fanc...@googlegroups.com
Fancybox PDF (iframe) works fine on Safari and Firefox.
Doesn't open in Chrome - I just get the loading gif forever.

$(".fancypdf").fancybox({
                padding : 5,
framewidth : 855,
frameheight : 470,
openEffect : 'elastic',
openSpeed  : 'normal',
openEasing : 'easeOutBack',
closeEffect : 'elastic',
closeSpeed  : 'normal',
closeEasing : 'easeInBack',
closeClick : true,
                type:'iframe',
});

On iPad, the dimensions are completely wrong.  Width is fine, but height opens at about 200px.  Pictures and Videos open normally.


Thanks for the help!! :)

JFK

unread,
Apr 28, 2013, 2:28:19 AM4/28/13
to fanc...@googlegroups.com
Upgrade to v2.1.4 then try adding the option

iframe : {
  preload: false
}

BTW these
 framewidth : 855,
 frameheight : 470

should be
 width : 855,
 height : 470

Myles Lam

unread,
Apr 28, 2013, 6:14:08 PM4/28/13
to fanc...@googlegroups.com
I changed it to this and it works now:

$(".fancypdf").click(function() {
  $.fancybox({
padding: 5,
    width: 800, 
    height: 607,
    autoSize: false,
openEffect : 'elastic',
openSpeed  : 'normal',
openEasing : 'easeOutBack',
closeEffect : 'elastic',
closeSpeed  : 'normal',
closeEasing : 'easeInBack',
closeClick : true,
    content: '<embed src="'+this.href+'#nameddest=self&page=1&view=FitH,0&zoom=80,0,0" type="application/pdf" height="99%" width="100%" />',
    onClosed: function() {
      $("#fancybox-inner").empty();
   }
  });
  return false;
  }); 
Reply all
Reply to author
Forward
0 new messages