summaryrefslogtreecommitdiffstats
path: root/phpfspot.js
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2008-01-20 09:21:39 +0100
committerAndreas Unterkircher <unki@netshadow.at>2008-01-20 09:21:39 +0100
commit9db171ee763fbf5ba6d7f5cebd565e14d55b4ce0 (patch)
tree34b8cba20f4d8a598806b4b56e79cc7ff16a3c56 /phpfspot.js
parent13f892f91316f539696b09e484fab999a16ff13b (diff)
issue102, add now function which finds out the correct thumbnail position also in IE
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
Diffstat (limited to 'phpfspot.js')
-rw-r--r--phpfspot.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/phpfspot.js b/phpfspot.js
index ad4a63e..7e18d3c 100644
--- a/phpfspot.js
+++ b/phpfspot.js
@@ -29,11 +29,21 @@ function moveToThumb(thumb_id)
return;
if(thumbimg = document.getElementById('thumbimg' + thumb_id)) {
- window.scrollTo(0, thumbimg.offsetTop-100);
+ window.scrollTo(0, findPos(thumbimg)-100);
}
} // moveToThumb()
+function findPos(obj) {
+ var curtop = 0;
+ if (obj.offsetParent) {
+ do {
+ curtop += obj.offsetTop;
+ } while (obj = obj.offsetParent);
+ }
+ return [curtop];
+}
+
function showCredits()
{
var credits = document.getElementById("content");