projects
/
phpfspot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
issue102, add now function which finds out the correct thumbnail position also in IE
[phpfspot.git]
/
phpfspot.js
diff --git
a/phpfspot.js
b/phpfspot.js
index c4b39b55a5cac2ff95228b927856dd6f3cd589b1..7e18d3c5fcd63ae37b8f5550982c271f24cb9042 100644
(file)
--- a/
phpfspot.js
+++ b/
phpfspot.js
@@
-1,6
+1,9
@@
function showImage(id, scrollup)
{
function showImage(id, scrollup)
{
- content = document.getElementById("content");
+ if(!document.getElementById('content'))
+ return;
+
+ var content = document.getElementById('content');
/* blank the screen */
if(scrollup != undefined) {
/* blank the screen */
if(scrollup != undefined) {
@@
-26,11
+29,21
@@
function moveToThumb(thumb_id)
return;
if(thumbimg = document.getElementById('thumbimg' + thumb_id)) {
return;
if(thumbimg = document.getElementById('thumbimg' + thumb_id)) {
- window.scrollTo(0,
thumbimg.offsetTop
-100);
+ window.scrollTo(0,
findPos(thumbimg)
-100);
}
} // moveToThumb()
}
} // 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");
function showCredits()
{
var credits = document.getElementById("content");
@@
-433,13
+446,13
@@
function startSlideShow()
function nextSlide()
{
function nextSlide()
{
- next_img = HTML_AJAX.grab(encodeURI('rpc.php?action=get_next_slideshow_img'));
+
var
next_img = HTML_AJAX.grab(encodeURI('rpc.php?action=get_next_slideshow_img'));
document.getElementById('slide_img').src = next_img;
}
function prevSlide()
{
document.getElementById('slide_img').src = next_img;
}
function prevSlide()
{
- prev_img = HTML_AJAX.grab(encodeURI('rpc.php?action=get_prev_slideshow_img'));
+
var
prev_img = HTML_AJAX.grab(encodeURI('rpc.php?action=get_prev_slideshow_img'));
document.getElementById('slide_img').src = prev_img;
}
document.getElementById('slide_img').src = prev_img;
}
@@
-480,8
+493,8
@@
function autoBrowse()
}
/* we have reached the last photo */
else {
}
/* we have reached the last photo */
else {
- if(document.getElementById('autobrowse_ico'))
-
document.getElementById('autobrowse_ico')
.src = "resources/32_play.png";
+ if(
ab_ico =
document.getElementById('autobrowse_ico'))
+
ab_ico
.src = "resources/32_play.png";
clearInterval(autobrowse);
}
clearInterval(autobrowse);
}