summaryrefslogtreecommitdiffstats
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 11:17:27 +0100
commita97d8efa5e25b656e7f56fc954468aa36a7979fe (patch)
tree9ded719de5492dd454c1c49c1dbbdd625859e1cf
parent13f892f91316f539696b09e484fab999a16ff13b (diff)
issue102, add now function which finds out the correct thumbnail position also in IE
issue102, changelog info Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
-rw-r--r--CHANGELOG1
-rw-r--r--phpfspot.js12
2 files changed, 12 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index d65d418..7b0d187 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -7,6 +7,7 @@ phpfspot (1.3)
* bug, fixed image handling which were slender enough, but too high.
* bug, fix for PDO sqlite when trying to fetch one single row (contributed by
* bug, fix for incorrect SQL query (contributed by Arun Persaud).
+ * bug, fixed window-movement when switching between photo index & photo
* feature, removed much of HTML tables to speed up GUI & CSS cleanup
* feature, key navigation (next/prev photo, photo index, reset all).
* feature, gen_thumbs.php has a new overwrite-thumbnails option.
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");