views:

166

answers:

2

How to position the fancybox 100px from top by default it is center aligned.

I believe there is no api settings for that. Can anyone help me out in doing it on the actual script.

A: 

I've never used fancybox myself but it looks like you need to set centerOnScroll to false and then position the #fancybox-wrap with css however you see fit.

joeynelson
Hi, the centerOnScroll is false by default and it will only make the fancybox fixed to the position which it opened. Which doesn't fullfill my requirement where the fancybox openup 150px top from the current view port and it still remains visible even after scroll.
Nizam
+2  A: 

$.fancybox({ 'width' : 620, 'height' : 490, 'speedIn' :600, 'speedOut' :200, 'onComplete': function() { $("#fancybox-wrap").css({'top':'20px', 'bottom':'auto'}); } });

ziasumo