Sign Up! Login: Password: New User? Forgot? Support
Top Mods!
Wowhead Search
by sonofsamedi
Digital Clock
by Wolfar15
Admin Forums
Welcome to the GuildPortal Help Community! These forums are for admin-to-admin help.
Available Forums
Forums : Pimp My Site! > Image Gallery popup (facebox)
Mottie (MVP) 10/10/2008 7:18 AM EST : Image Gallery popup (facebox)
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Image Gallery Popups

This short script makes the links in your "Image Gallery" (Static List & Scrolling Gallery) open the image in a pop up window (facebox) instead of on a new page. It will also make the "Open Full Gallery" link open a popup window. Add it to your header, footer or anywhere on the page to make it work.

If you want to change the style of the facebox pop up, including the "close" image, read this post.

Also, check out this post on how to modify some things in the image gallery (like adding a previous and next image button)

The Code

<script type="text/javascript">
$(document).ready(function() {
 // Image Gallery: Static List
 $("a[target*=ImageView]").facebox();
 // Image Gallery: Scrolling Gallery
 $("img[title*='- Click to advance to the next image.']").each(function(){
 $(this).attr("title",$(this).attr("title").replace(" - Click to advanceto the next image.","")).parent().attr("target","").facebox();
 })
});
</script>

Customizing
  • Change the numbers in red to adjust the width (700) and height (400) of the popup window.
Edit (10/12/2008): Added "Scrolling Gallery" and made the "Open Full Gallery" link open in a popup window
Edited (1/14/2009): Updated the code, to reflect changes made to theimage gallery: modified the scrolling gallery script and removed theopen full gallery in a popup window, since it does this by default now.I also added a link to a post on modifying the image gallery.
TopBottom

Avandius (New Admin) 10/10/2008 9:19 AM EST : RE: Image Gallery popup (facebox)
Avandius
Posts: 337
Fingers of Fury!

Sexy! Thanks Mottie.
TopBottom

Tarkadahl (Guild Admin) 10/12/2008 12:52 AM EST : RE: Image Gallery popup (facebox)
Tarkadahl
Posts: 479
Fingers of Fury!

Nice, thanks



                   Tarkafunk L80 (AOC), L70 (WoW), EQ2, AO, SWG, EVE                        
TopBottom

Eph (MVP) 10/12/2008 3:49 AM EST : RE: Image Gallery popup (facebox)
GuildPortal MVP
Eph
Posts: 596
Zomgawsh Poster

Which content type is this for?

Image Gallery
Random Categorized Image
or Random Thumbnails
??

Just curious because I have the Image Gallery, and when I click on a thumbnail it opens the pic on the samepage, under all of the thumbnails...it has always done this.

I did put the code in my footer because I think having them pop up in a facebox is sweet, but it didn't change anything.

Maybe I did something wrong? Or maybe your talking about some other kind of image gallery?

Bah I'm to tired
TopBottom

Mottie (MVP) 10/12/2008 3:55 AM EST : RE: Image Gallery popup (facebox)
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Sorry I should have clarified.

This script is for the "Image Gallery" when the "Static List" option is being used... I know the "Scrolling Gallery"option is broken, so I'll work on that next 

Ok, now it'll work with the "Image Gallery: Scrolling Gallery" too!

And now the "Open Full Gallery" link will open a popup window (not facebox.. that didn't work very well).
TopBottom

Admins Online
There are   members online.
So-and-so has logged on!
%title%
%message%