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.
Asked
Active
Viewed 3,408 times
4
-
1the link from the plugins page @ http://plugins.jquery.com/project/galleryview seems to be broken and without any demos to example code for this jQuery plugin. – evandrix Sep 02 '11 at 01:34
-
http://plugins.jquery.com/node/13734 – spotlr Sep 08 '11 at 17:56
-
@Doug: image tag don't have href attribute, ps, provide your current help, if you want a quick help. – Luca Filosofi Sep 11 '11 at 08:39
2 Answers
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