ask91
ask91

Reputation: 45

Where to modify fancybox pop up element position behaviour?

I'm using fancybox 2.1.4 in a gallery that shows pop up image. based on the default setting, position of the box contained pop up image in fancybox, will appear fix to the screen windows. Is it possible to make the pop up image box appear fix to the html page, not the screen? Where to modify this pop up position behaviour? is it in jquery.fancybox.js or jquery.fancybox.css? because i can't seem to find the 'fix' rule that make it default fix to the screen.

Upvotes: 1

Views: 1980

Answers (1)

JFK
JFK

Reputation: 41143

You have to set the fancybox API options autoCenter and locked to false like :

$(function () {
    $(".fancybox").fancybox({
        autoCenter: false,
        helpers: {
            overlay: {
                locked: false
            }
        }
    });
});

Where? in your own custom fancybox script; no need to mess with the original files.

See JSFIDDLE

Upvotes: 2

Related Questions