"Next" in embedded gallery goes up to top of page

maddogprod

Joined: 2008-09-05
Posts: 9
Posted: Wed, 2008-09-17 02:59

I've embedded a gallery using the gallery2embedded.php method and it works great. The only problem is that the header is a big large. You scroll down a half page to view the photos in a gallery, and when you click NEXT or PREVIOUS, it goes to the next photo but returns to the top of the page so you have to scroll down a half page again. How do I stop it from returning to the top of the page when you click NEXT?

Thanks!
Mad Dog

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2008-09-17 03:53

Please post a link to your site.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
maddogprod

Joined: 2008-09-05
Posts: 9
Posted: Wed, 2008-09-17 13:03

http://www.belvederelagoon.org/gallery2embedded.php

For now. It will probably be changed since if I can't get this "go to top of page" problem solved the client will want to get rid of the header.

But looking at the regular, plain vanilla Gallery2, it does the same thing:
http://www.belvederelagoon.org/gallery/

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2008-09-17 13:39

I see what's going on. So if you browse the site in a small window and scroll down, then click next, it's not just loading the next photo, but actually a new page so you're getting "popped" to the top of the page. Which I guess you explained in your first post but I didn't realize it ;)

You either need to do some modifications to your theme (and the navigation template) to use Ajax to load the image on the page without loading a new page. The problem with that is you won't be able to bookmark that page/photo as the URL won't be pointing to the correct photo.

I'd personally take a look at a few different themes that do this, Ajaxian and Slider. They may not be what you're looking for, but they might give you some ideas or at least the bits of code you'd need to make a hack ;). I'd also take a look at Siriux as that puts the navigation on the photo itself, but still loads a new page when clicking on Next/Previous so if you have a "tall" header, you'll end up with the same results.

Ajaxian info and example:
http://codex.gallery2.org/Gallery2:Themes:ajaxian
It still reloads the page when changing to different albums (don't think there is a way to get around that without a lot of coding), but once in an album you can browse that album without reloading the page

Slider info and example:
http://codex.gallery2.org/Gallery2:Themes:slider
IIRC Slider does NOT display or care about Albums. So if your main page (or any album) only has albums in it, then you MUST use a different theme for that album. Only apply slider to albums that only contain pictures. Slider will not display albums. Hope I made that clear ;)

Sirux example:
http://siriux.net/photos/main.php

And the "official" demos of Gallery themes, both "standard" themes and 3rd party themes:
http://themes.gallery2.hu/

There are some really cool, sexy themes where if you have the skills, I don't unfortunately, with a little ajax, they could be way more sexy IMO. Me, I'd have to start with working on the Ajaxian or Slider theme and hacking something up, hopefully getting something working..... My idle theme would be a combination of a few of them out there. Ajaxian with a little bit of Siriux and even a few features from PGtheme or X_treme theme.

You could also always tell your client to just get a bigger monitor ;) I didn't have any problem browsing the site at 1600x1200 ;)

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
maddogprod

Joined: 2008-09-05
Posts: 9
Posted: Wed, 2008-09-17 13:55

Thanks. I looked at other themes but they don't remotely fit into the look of the site and the client doesn't want to pay for massive theme modifications. I tried to get Lightbox integrated into it, which would have done the trick, but never could get it working. I've used it many times on other non-Gallery2 sites without a problem and don't know why it wouldn't work here, nor did I get any forum help on that one.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2008-09-17 14:15

I've seen a few other people having problems getting Lightbox working. I want to use Lightbox on my site too, but haven't taken the time. I've seen about 3 different versions of instructions, each different, and I have a feeling something is outdated.

That's something I'm going to try to find the time to work on this weekend for my site.

OH, that just reminded me of another theme. I'll have to bug the person who maintains the Theme demo site as to why this one isn't there:
http://codex.gallery2.org/Gallery2:Themes:siriux_ijonized
demo: http://ijon.info/galeria/album/pani_ijonowa/makro-robale/
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here