Skip to content

Commit

Permalink
modifying default settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-ren committed Feb 14, 2012
1 parent 3c34f45 commit e2122b3
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions src/facebox.js
Expand Up @@ -82,18 +82,17 @@

$.extend($.facebox, {
settings: {
opacity : 0.2,
opacity : 0.75,
overlay : true,
modal : true,
loadingImage : '/facebox/loading.gif',
closeImage : '/facebox/closelabel.png',
modal : true,
loadingImage : null,
closeImage : null,
imageTypes : [ 'png', 'jpg', 'jpeg', 'gif' ],
faceboxHtml : '\
<div id="facebox" style="display:none;"> \
<div class="popup"> \
<div class="content"> \
</div> \
<a href="#" class="close"></a> \
</div> \
</div>'
},
Expand All @@ -107,19 +106,19 @@
append('<div class="loading"><img src="'+$.facebox.settings.loadingImage+'"/></div>')

$('#facebox').show().css({
top: getPageScroll()[1] + (getPageHeight() / 10),
left: $(window).width() / 2 - ($('#facebox .popup').outerWidth() / 2)
top: getPageScroll()[1] + (getPageHeight() / 10),
left: $(window).width() / 2 - ($('#facebox .popup').outerWidth() / 2)
})

$(document).bind('keydown.facebox', function(e) {
if (e.keyCode == 27) {
if ($.facebox.settings.modal !== true) {
$.facebox.close()
}
else {
$('.close').click()
}
}
if ($.facebox.settings.modal !== true) {
$.facebox.close()
}
else {
$('.close').click()
}
}
return true
})
$(document).trigger('loading.facebox')
Expand Down Expand Up @@ -204,7 +203,7 @@
if (self.pageYOffset) {
yScroll = self.pageYOffset;
xScroll = self.pageXOffset;
} else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
} else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
yScroll = document.documentElement.scrollTop;
xScroll = document.documentElement.scrollLeft;
} else if (document.body) {// all other Explorers
Expand All @@ -217,7 +216,7 @@
// Adapted from getPageSize() by quirksmode.com
function getPageHeight() {
var windowHeight
if (self.innerHeight) { // all except Explorer
if (self.innerHeight) { // all except Explorer
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowHeight = document.documentElement.clientHeight;
Expand Down Expand Up @@ -284,9 +283,9 @@
$('#facebox_overlay').hide().addClass("facebox_overlayBG")
.css('opacity', $.facebox.settings.opacity)
.click(function() {
if ($.facebox.settings.modal !== true)
$(document).trigger('close.facebox')
})
if ($.facebox.settings.modal !== true)
$(document).trigger('close.facebox')
})
.fadeIn(200)
return false
}
Expand Down

0 comments on commit e2122b3

Please sign in to comment.