issue102, add now function which finds out the correct thumbnail position also in IE
authorAndreas Unterkircher <unki@netshadow.at>
Sun, 20 Jan 2008 08:21:39 +0000 (09:21 +0100)
committerAndreas Unterkircher <unki@netshadow.at>
Sun, 20 Jan 2008 10:17:27 +0000 (11:17 +0100)
issue102, changelog info

Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
CHANGELOG
phpfspot.js

index d65d418309014278bf2776663164505ca27a5afc..7b0d187b99954e8d6c55c8e6769f3dde325a75d7 100644 (file)
--- 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.
index ad4a63e088bdc12ee06f5227a0ac8dc329cb9625..7e18d3c5fcd63ae37b8f5550982c271f24cb9042 100644 (file)
@@ -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");