Reputation: 2294
Can anyone help me to show lightbox popup for links such as below,
When anyone clicked below links it should show in jquery lightbox instead open in target blank or redirect on the same browser.
Upvotes: 0
Views: 76
Reputation: 6975
I think this will work
<script type="text/javascript">
$(document).ready(function() {
$("a", ".rest-menuitem").click(
function(event) {
event.preventDefault();
var elementURL = $(this).attr("href");
$.colorbox({iframe: true, href: elementURL, innerWidth: 645, innerHeight: 509});
});
});
</script>
Set innerWidth and innerHeight according to your content.
Upvotes: 1
Reputation: 20428
if you use fancybox plugin this will works..
<a id="manual1" data-image="/example-full.jpg,/example-full-2.jpg'><img src="/example-thumb.png" alt="example" /></a>
<script type="text/javascript">
$('#manual1').click(function() {
var data = $(this).data('images').split(','),
options = {
padding : 38,
nextEffect : 'fade',
prevEffect : 'fade',
type: 'image'
};
$.fancybox.open(data , options );
})
</script>
Fiddle is : http://jsfiddle.net/voigtan/jJpAM/2/
Upvotes: 1