I am using this code to grab a class value from an a href:
<a href="" class="images/success.jpg">Click to get image</a>
<script>
$("#myMenu a").bind("click", function() {
var myPic = $(this).attr("class");
alert(myPic);
});
</script>
Everything working normal and smooth. Now I am using fancybox to load images and I have this code of fancy box that works normal also:
$.fancybox.open('images/success.jpg');
I am trying to pass the variable myPic into fancybox code but I cant make it.
So far I have tried this:
$.fancybox.open(myPic);
$.fancybox.open('myPic');
Is there any possibility to make it work?