forum.coppermine-gallery.net

Support => Older/other versions => cpg1.3.x Support => Topic started by: stormlifter on June 06, 2005, 06:08:19 pm

Title: Click next and have page re-center
Post by: stormlifter on June 06, 2005, 06:08:19 pm
So I want to know if there is a way to make it so when I click "next" on a picture to see the next one if there was a way to make it so my page will go back to the position I had it before I clicked next.

If you didn't understand that... lemme try again.

I have my screen adjusted to see the picture perfectly.   I click next, the screen returns to the top.   I want it to stay at the "perfectly adjusted" place... a few notches down the page :)

Thanks!
Title: Re: Click next and have page re-center
Post by: kegobeer on June 06, 2005, 08:45:19 pm
You can use named anchors (www.site.com/#anchor) to jump to a predefined place.  What looks perfect on your screen may not look perfect for your visitors.

It is possible to do what you want.  I don't have access to my files now, but I can look around later.  Or you can view source on your page, find where you want to put a named anchor, then look around your theme.php file and  put the named anchor where you want it, and then modify the code for the previous/next buttons and add the named anchor reference to it.
Title: Re: Click next and have page re-center
Post by: stormlifter on June 07, 2005, 12:14:44 am
Alrighty... well I'm not exactly sure how to exicute this, but I'll stay tuned if you wish to teach me and I promise to learn quick :)
Title: Re: Click next and have page re-center
Post by: Joachim Müller on June 07, 2005, 06:44:07 am
not tested, but this is what I'd suggest: edit themes/yourtheme/theme.php, find
Code: [Select]
// HTML template for the image navigation bar
$template_img_navbar = <<<EOT

        <tr>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{THUMB_TGT}" class="navmenu_pic" title="{THUMB_TITLE}"><img src="images/folder.gif" width="16" height="16" align="absmiddle" border="0" alt="{THUMB_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="javascript:;" onClick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}"><img src="images/info.gif" width="16" height="16" border="0" align="absmiddle" alt="{PIC_INFO_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{SLIDESHOW_TGT}" title="{SLIDESHOW_TITLE}"><img src="images/slideshow.gif" width="16" height="16" border="0" align="absmiddle" alt="{SLIDESHOW_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" witdh="100%">
                        {PIC_POS}
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{ECARD_TGT}" title="{ECARD_TITLE}"><img src="images/ecard.gif" width="16" height="16" border="0" align="absmiddle" alt="{ECARD_TITLE}"></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{PREV_TGT}" class="navmenu_pic" title="{PREV_TITLE}"><img src="images/prev.gif" width="16" height="16" border="0" align="absmiddle" alt="{PREV_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{NEXT_TGT}" class="navmenu_pic" title="{NEXT_TITLE}"><img src="images/next.gif" width="16" height="16" border="0" align="absmiddle" alt="{NEXT_TITLE}" /></a>
                </td>
        </tr>

EOT;
and replace with
Code: [Select]
// HTML template for the image navigation bar
$template_img_navbar = <<<EOT

        <tr>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a name="my_anchor"></a>
                        <a href="{THUMB_TGT}" class="navmenu_pic" title="{THUMB_TITLE}"><img src="images/folder.gif" width="16" height="16" align="absmiddle" border="0" alt="{THUMB_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="javascript:;" onClick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}"><img src="images/info.gif" width="16" height="16" border="0" align="absmiddle" alt="{PIC_INFO_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{SLIDESHOW_TGT}" title="{SLIDESHOW_TITLE}"><img src="images/slideshow.gif" width="16" height="16" border="0" align="absmiddle" alt="{SLIDESHOW_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" witdh="100%">
                        {PIC_POS}
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{ECARD_TGT}" title="{ECARD_TITLE}"><img src="images/ecard.gif" width="16" height="16" border="0" align="absmiddle" alt="{ECARD_TITLE}"></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{PREV_TGT}#my_anchor" class="navmenu_pic" title="{PREV_TITLE}"><img src="images/prev.gif" width="16" height="16" border="0" align="absmiddle" alt="{PREV_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{NEXT_TGT}#my_anchor" class="navmenu_pic" title="{NEXT_TITLE}"><img src="images/next.gif" width="16" height="16" border="0" align="absmiddle" alt="{NEXT_TITLE}" /></a>
                </td>
        </tr>

EOT;
Title: Re: Click next and have page re-center
Post by: stormlifter on June 07, 2005, 04:51:00 pm
Thanks... I think i'll go ahead and apply that code now.