Ron
Ron

Reputation: 394

Jquery fancybox pop-up to show in the middle of the screen

I am creating a Facebook app where there is a fancy-box pop-up appearing when I click on a button , for web the pop-up is opening at the middle of the display(monitor) but when I check it in Ipad it comes at the middle of the app which is not the middle of the screen of the ipad .(As the button is in the header section and I have long content and images in the app ie the app page is long in height ).

I have tried to calculate the top and reassign the positions but it doesn't working in case of ipad.

Fancybox version is 2.1.5

Any help regarding this will be appreciable.

Upvotes: 0

Views: 1088

Answers (1)

bastos.sergio
bastos.sergio

Reputation: 6764

Try setting the autoCenter property to true.

Example 1:

$("#single_1").fancybox({
      autoCenter: true,
      ...
  });

If that doesn't work, try repositioning the fancybox to the available screen width/height.

Example 2:

$.fancybox.reposition()

Upvotes: 1

Related Questions