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'
            }
        }
    });
    }); 

How can I pass my ID to fancy box when I click the image

I don't understand what you're asking here. Can you clarify this question a little more? Maybe describe the problem you are seeing rather than what you might think is the problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.