How to center fancyBox

278 views
Skip to first unread message

Tream

unread,
May 24, 2012, 3:49:33 AM5/24/12
to fanc...@googlegroups.com
Hi,
I am looking for a possibility to center the fancybox in viewport,
and making it scrollable.

An example, how it would be perfect (any example on that page):

http://fancybox.net/

I tried many things:

<style>
    .fancybox-wrap {
        position: absolute !important;
    }
</style>

$.fancybox.open("#div");
$.fancybox.reposition();

Or

$.fancybox.open("#div");
$(".fancybox-wrap").css("top",pos+"px); // pos = height in px

But the fancybox is always on top of the page.

Maybe somebody can help me with that.

JFK

unread,
May 24, 2012, 1:10:42 PM5/24/12
to fancybox
most likely you have general css rules that affect fancybox like

div {
position: abolute;
}

use specificity instead like

div#mydiv {
position: abolute;
}

or show a link
Reply all
Reply to author
Forward
0 new messages