Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container target #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/facebox.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
*
* jQuery(document).trigger('close.facebox')
*
* Want to inject Facebox into another element?
*
* jQuery.facebox({ container: 'some_selector' })
*
* Facebox also has a bunch of other hooks:
*
* loading.facebox
Expand Down Expand Up @@ -82,6 +86,7 @@

$.extend($.facebox, {
settings: {
container : 'body',
opacity : 0.2,
overlay : true,
loadingImage : '/facebox/loading.gif',
Expand Down Expand Up @@ -172,7 +177,7 @@
$.facebox.settings.imageTypesRegexp = new RegExp('\\.(' + imageTypes + ')(\\?.*)?$', 'i')

if (settings) $.extend($.facebox.settings, settings)
$('body').append($.facebox.settings.faceboxHtml)
$($.facebox.settings.container).append($.facebox.settings.faceboxHtml)

var preload = [ new Image(), new Image() ]
preload[0].src = $.facebox.settings.closeImage
Expand Down