4

I've upgraded to jQuery GalleryView 2.1.1 and it doesn't seem to support ahref tags on the images. Is there a workaround for this? I want to be able to display the title on image mouseover and redirect to another page onclick.

Doug
  • 41
  • 1
  • 3

2 Answers2

3
$('#gallery .panel img').hover(function() {
    $(this).wrap('<a href="' + this.src + '" target="_blank"/>');
}, function() {
    $(this).unwrap('<a></a>');
});
Luca Filosofi
  • 30,905
  • 9
  • 70
  • 77
1

here is what i did: i used the panel-overlay as the object to be clicked.
i added an A tag to it so i can use its href attribute (see bellow)

<li><span class="panel-overlay"><a href="your_link_here" ></a></span><img  src="pic.jpg"  alt=""/></li>  

in the css file i made sure the panel-overlay covered the entire image and made it transparent.also added a hand cursor to it.

.panel .overlay-background { height: 666px; cursor:pointer;background: none; }

finally, inside the page's $(document).ready function i added:

   $(".panel-overlay").click(function() {
    //get the link href 
    var link = jQuery("a", this).attr('href');
    window.location.href = link;
   });  

hope this helps someone out there..
cheers :-)

samoyed
  • 881
  • 4
  • 13
  • 25