Position Fancy Box closer to the top

2,283 views
Skip to first unread message

Paolo Broccardo

unread,
Aug 18, 2010, 11:42:43 AM8/18/10
to fancybox
Hi

I have looked through everyone else's posts and have found nothing, so
I would appreciate it if someone could help me with this. I'm sure
this is a common request.

I would like my FancyBox to start closer to the top of the page, about
150 - 300px or so.

I have managed to get this to work somewhat by adding the following
line to the #fancybox-wrap class:
margin-top:-10%;

Now, this works when the content is not too long / high, but once the
content gets large, the fancybox moves upwards past the top of the
screen.

Obviously, my approach is not correct. How would I accomplish this?
It's almost like if the content is long, the fancybox should expand
downwards and not upwards.

Any help would be greatly appreciated.

Paolo Broccardo

unread,
Aug 19, 2010, 4:21:44 AM8/19/10
to fancybox
Hi - anyone?

Surely this shouldn't be too complicated to do? Other similar plugins
like Facebox are positioned slightly higher.

Please help

Thanks

JFK

unread,
Aug 19, 2010, 5:45:11 AM8/19/10
to fancybox
the only workaround I can think is overriding the position with a css
declaration (AFTER you have linked the fancybox css file) like:

<style type="text/css">
/* place fancybox 150px from top of the viewport */
div#fancybox-wrap {top:150px !important;}
</style>

this will affect all your fancyboxes though

Paolo Broccardo

unread,
Aug 19, 2010, 11:14:57 AM8/19/10
to fancybox
Thanks JFK. I do not mind having to put that in to get it to work.
Looking good now! Thanks again. Cheers!
Reply all
Reply to author
Forward
0 new messages