Hi, How can I pass my ID to fancy box when I click the image? When I use alert it show I success to get class attribute ".image" and show 1 for the id. But how come it's not working after I add $('#'+currentId).fancybox and the following code?
This is my html link :
<a id="1" class="image ajax" href="images/1.jpg" title="Photo number 1">
<img alt="Photo number 1" src="images/1.jpg">
</a>
and this is my jquery script:
$('.image').click(function() {
var currentId = $(this).attr('id');
$('#'+currentId).fancybox({
openEffect : 'elastic',
closeEffect : 'elastic',
helpers : {
title : {
type : 'inside'
}
}
});
});