What it does?
PART 1: When the display image page loads, it "jumps" to the actual image area (skipping the headers). Focus is also shifted to the page, which is useful when pulling up pictures from locations outside of CPG (such as when using CPMFETCH).
PART 2: When the file information icon is clicked, it "jumps" to the file information area (provided it's visible).
Compatibility?
CPG: Tested on the very latest CVS 1.4 beta, but should work on 1.3 as well (I think).
CPG THEME: Tested on "classic" theme, but should work in others as well.
Browser: Tested in Firefox 1.0 and IE 6.0, but should work from IE 5+ (and hopefully degrade well).
Requirements?
Javascript in Browser must be enabled.
Difficulty of installation?
Pretty easy, I think. Just a couple of lines of code in 2 files.
Known issues?
None. (Previous reported issue has been corrected.)
PART 1 INSTALLATION:
Browse to your favorite CPG theme folder. In
template.html, find the text
{GALLERY}, and REPLACE WITH:
<a name="nav_pic" id="nav_pic"></a>
{GALLERY}
<script language="javascript" type="text/javascript">
this.focus();
if (window.location.search.indexOf('pos=') != -1) {
window.location.href = '#nav_pic';
}
</script>
PART 2 INSTALLATION:
In
include/themes.inc.php, FIND (around line 639):
<a href="javascript:;" class="navmenu_pic" onclick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}"><img src="{LOCATION}images/info.gif" border="0" align="middle" alt="{PIC_INFO_TITLE}" /></a>
REPLACE WITH:
<a href="javascript:;" class="navmenu_pic" onclick="blocking('picinfo','yes', 'block'); if (document.getElementById('picinfo') && document.getElementById('picinfo') != 'none') { window.location.href = '#nav_picinfo'; } return false;" title="{PIC_INFO_TITLE}"><img src="{LOCATION}images/info.gif" border="0" align="middle" alt="{PIC_INFO_TITLE}" /></a>
FIND (around line 1955):
echo "<div id=\"picinfo\" style=\"display: $picinfo;\">\n";
REPLACE WITH:
echo "<a name=\"nav_picinfo\" id=\"nav_picinfo\"></a><div id=\"picinfo\" style=\"display: $picinfo;\">\n";
Preview?
http://www.snakesofarkansas.com/galleries/Your feedback is welcome. Thanks.