| 1 |
/* $Id: lightbox.js,v 1.5.2.6.2.118 2009/05/02 02:19:11 snpower Exp $ */ |
/* $Id: lightbox.js,v 1.5.2.6.2.119 2009/05/08 15:05:49 snpower Exp $ */ |
| 2 |
|
|
| 3 |
/** |
/** |
| 4 |
* jQuery Lightbox |
* jQuery Lightbox |
| 643 |
// Handle display of image content. |
// Handle display of image content. |
| 644 |
else { |
else { |
| 645 |
$('#imageContainer').show(); |
$('#imageContainer').show(); |
| 646 |
if($.browser.safari) { |
if ($.browser.safari) { |
| 647 |
$('#lightboxImage').css({'zIndex': '10500'}).show(); |
$('#lightboxImage').css({'zIndex': '10500'}).show(); |
| 648 |
} |
} |
| 649 |
else { |
else { |
| 949 |
// Returns array with page width, height and window width, height. |
// Returns array with page width, height and window width, height. |
| 950 |
// Core code from - quirksmode.com. |
// Core code from - quirksmode.com. |
| 951 |
// Edit for Firefox by pHaez. |
// Edit for Firefox by pHaez. |
| 952 |
|
|
| 953 |
getPageSize : function() { |
getPageSize : function() { |
| 954 |
|
|
| 955 |
var xScroll, yScroll; |
var xScroll, yScroll; |
| 956 |
|
|
| 957 |
if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac |
if (window.innerHeight && window.scrollMaxY) { |
|
xScroll = document.body.scrollWidth; |
|
|
yScroll = document.body.scrollHeight; |
|
|
} |
|
|
else if (window.innerHeight && window.scrollMaxY) { |
|
| 958 |
xScroll = window.innerWidth + window.scrollMaxX; |
xScroll = window.innerWidth + window.scrollMaxX; |
| 959 |
yScroll = window.innerHeight + window.scrollMaxY; |
yScroll = window.innerHeight + window.scrollMaxY; |
| 960 |
} |
} |
| 961 |
// Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari. |
else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac. |
| 962 |
else { |
xScroll = document.body.scrollWidth; |
| 963 |
|
yScroll = document.body.scrollHeight; |
| 964 |
|
} |
| 965 |
|
else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari. |
| 966 |
xScroll = document.body.offsetWidth; |
xScroll = document.body.offsetWidth; |
| 967 |
yScroll = document.body.offsetHeight; |
yScroll = document.body.offsetHeight; |
| 968 |
} |
} |
| 978 |
} |
} |
| 979 |
windowHeight = self.innerHeight; |
windowHeight = self.innerHeight; |
| 980 |
} |
} |
| 981 |
// Explorer 6 Strict Mode. |
else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode. |
|
else if (document.documentElement && document.documentElement.clientHeight) { |
|
| 982 |
windowWidth = document.documentElement.clientWidth; |
windowWidth = document.documentElement.clientWidth; |
| 983 |
windowHeight = document.documentElement.clientHeight; |
windowHeight = document.documentElement.clientHeight; |
| 984 |
} |
} |
| 986 |
windowWidth = document.body.clientWidth; |
windowWidth = document.body.clientWidth; |
| 987 |
windowHeight = document.body.clientHeight; |
windowHeight = document.body.clientHeight; |
| 988 |
} |
} |
| 989 |
|
// For small pages with total height less than height of the viewport. |
|
|
|
|
// For small pages with total height less then height of the viewport. |
|
| 990 |
if (yScroll < windowHeight) { |
if (yScroll < windowHeight) { |
| 991 |
pageHeight = windowHeight; |
pageHeight = windowHeight; |
| 992 |
} |
} |
| 993 |
else { |
else { |
| 994 |
pageHeight = yScroll; |
pageHeight = yScroll; |
| 995 |
} |
} |
| 996 |
|
// For small pages with total width less than width of the viewport. |
|
|
|
|
// For small pages with total width less then width of the viewport. |
|
| 997 |
if (xScroll < windowWidth) { |
if (xScroll < windowWidth) { |
| 998 |
pageWidth = windowWidth; |
pageWidth = xScroll; |
| 999 |
} |
} |
| 1000 |
else { |
else { |
| 1001 |
pageWidth = xScroll; |
pageWidth = windowWidth; |
| 1002 |
} |
} |
| 1003 |
|
arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight); |
|
arrayPageSize = [pageWidth, pageHeight, windowWidth, windowHeight]; |
|
| 1004 |
return arrayPageSize; |
return arrayPageSize; |
| 1005 |
}, |
}, |
| 1006 |
|
|