X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.js;h=a2c848e5715bf5faf254eb39ceeab348d869c39c;hp=ad4a63e088bdc12ee06f5227a0ac8dc329cb9625;hb=217bca545926a2fc8989b874661fc2ecad4bbf9b;hpb=13f892f91316f539696b09e484fab999a16ff13b diff --git a/phpfspot.js b/phpfspot.js index ad4a63e..a2c848e 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"); @@ -67,7 +77,7 @@ function Tags(mode, id) refreshPhotoIndex(); } else { - window.alert(retr); + window.alert("Server message: "+ retr); } } // Tags() @@ -167,7 +177,7 @@ function startSearch() showPhotoIndex(); } else { - window.alert(retr); + window.alert("Server message: "+ retr); } } // startSearch() @@ -524,7 +534,7 @@ function update_sort_order(obj) showPhotoIndex(); } else { - window.alert(retr); + window.alert("Server message: "+ retr); } } // update_sort_order()