diff options
author | Andreas Unterkircher <unki@netshadow.at> | 2008-04-25 20:02:07 +0200 |
---|---|---|
committer | Andreas Unterkircher <unki@netshadow.at> | 2008-04-25 20:02:07 +0200 |
commit | 76a6bfc46c44621291bf023c81b12356200f0da5 (patch) | |
tree | 4fc5649b96d0e774555e44c9da8d48a0578c377b /themes/default/templates | |
parent | 736a480ac1273916c38287d0123d211449386a1d (diff) | |
parent | bb4fef295631d089240c09898411e656ab90e737 (diff) |
Merge branch 'master' of /var/cache/git/phpfspot
Diffstat (limited to 'themes/default/templates')
-rw-r--r-- | themes/default/templates/photo_index.tpl | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/themes/default/templates/photo_index.tpl b/themes/default/templates/photo_index.tpl index bf235d3..82f4959 100644 --- a/themes/default/templates/photo_index.tpl +++ b/themes/default/templates/photo_index.tpl @@ -103,18 +103,48 @@ <br class="clearboth" /> <script type="text/javascript" language="JavaScript"> <!-- + /*** image preloading ***/ { counter start=-1 } var current; var image_urls = new Array(); + var last_thumb; {section name="thumb" loop=$thumbs step=1} {if $images[thumb] } image_urls[{counter}] = 'phpfspot_img.php?idx={$images[thumb]}&width={$width}'; + last_thumb = {$images[thumb]}; {/if} {/section} preloadPhotos(image_urls); + + // auto-scroll + // + // if browser is to far down the page, that he can't see the photo at all + // scroll it up so that at least the last photo becomes visisble. + { literal } + + var ywnd = 0; + var yimg = 0; + // check where we are with the browser + if (window.pageYOffset) { + ywnd = window.pageYOffset; + } else if (document.body && document.body.scrollTop) { + ywnd = document.body.scrollTop; + } + // check the y-pos of the last thumbnail + if(thumbimg = document.getElementById('thumbimg' + last_thumb)) { + yimg = findPos(thumbimg,'top'); + } + // if the browser-window is scrolled further then the last_thumb, scroll back + if(ywnd > yimg) { + window.scrollTo(0, yimg-100); + } + + { /literal } + // auto-scroll + --> </script> <!-- /Photo Index --> |