Making the facebox Modal

81 views
Skip to first unread message

irshad

unread,
May 26, 2009, 2:28:34 AM5/26/09
to facebox
Sometimes we may require to make our facebox modal i.e do not allow
the background to be clickable when facebox is loaded.

I have one simple solution. Hope it helps you guys out there..

1.Add one parameter in settings

$.extend($.facebox, {
settings: {
opacity : 0.5,
overlay : true,
modal : true, //New parameter
........
}

2. Modify the function showOverlay()
replace the line .click(function() { $(document).trigger
('close.facebox') })
with .click(function() {
if ($.facebox.settings.modal != true)
$(document).trigger('close.facebox')
})

Make sure you set the value of opacity between 0 and 1, and the
overlay value to true.
Enjoy!

park

unread,
Jun 29, 2009, 3:47:29 AM6/29/09
to facebox
Works great!

Thanks for your sharing.
Reply all
Reply to author
Forward
0 new messages