Sign Up! Login: Password: New User? Forgot? Support
Code 
 
 
Forums 
Forums : Multimedia > Image Gallery popup
Mottie (SuperAdmin) 10/12/2008 4:50 AM EST : Image Gallery popup
ACK!
Mottie
Posts: 3884

0
Like

0
Dislike

Image Gallery Popups

GuildPortal admin site link to original post

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 advance to the next image.","")).parent().attr("target","").facebox();
 })
});
</script>
Edited (1/14/2009): Updated the code, to reflect changes made to the image gallery: modified the scrolling gallery script and removed the open 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.
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

 
 
Key 
New posts No new posts
New posts ( popular ) No new posts ( popular )
New posts ( sticky ) No new posts ( sticky )
New posts ( locked ) No new posts ( locked )
 
 
Who's Online 
There are   members online.
 
 
So-and-so has logged on!
%title%
%message%