GuildPortal will be going offline (permanently) by the end of the month.
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! > Replacing the Gallery Popup Window
Mottie (MVP) 7/27/2009 12:17 AM EST : Replacing the Gallery Popup Window
GuildPortal MVP
Posts: 3884
Zomgawsh Poster

Replacing the Gallery Popup Window

This script replaces an existing function of the image Gallery. The original script opens the gallery window inside the same window you see when you click the edit button inside your content boxes. It has a white background and is inside an iframe, making it much more difficult to add custom styles. So I went with this alternative method (the way it originally was set up) and open the image inside a facebox window.

Because this script needs to replace the existing function, this script needs to be in a free form text/HTML content box below (and to the right) or in the Footer HTML of the image gallery.
<script type="text/javascript">
var showGalleryImage = function(sGalleryImgPath, sDescription){
 imgHolder.fadeOut('2500', function(){
  imgHolder.attr("src", sGalleryImgPath);
  imgHolder.bind("click", function(){jQuery.facebox('<center><img src="'+sGalleryImgPath+'"><br><br><div class="desc">'+sDescription+'</div>') });
  imgHolder.parent().attr("href", "javascript:void(0);");
  imgHolder.fadeIn('1500', function() {});
I added a class around the description so you can add CSS to format the description text inside the facebox window. Here is an example of the CSS:
#facebox .desc { color:#ffffff; font-weight:bold; font-size:18px; }
You can see what this looks like on my test-site 3 Home tab.

I also updated the Modifying the Image Gallery post with this code.

Edit (7/28/2009): Fixed an error in the code.

Mottie (MVP) 7/28/2009 1:28 AM EST : RE: Replacing the Gallery Popup Window
GuildPortal MVP
Posts: 3884
Zomgawsh Poster

Fixed an error in the code... sorry =/

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