I have added some code to my site in an attempt to load a lightbox when clicking on an image. At the moment this code works but instead of showing the image in the lightbox, it just shows the image url. This is being loaded using "slider.currSlide.bigImage" in the code below. I'm not sure what I can add to this function so that it also loads the img tag and brackets around it, thus loading the actual image in the lightbox. Any help would be greatly appreciated.
function add_additional_rs_code() {
?>
var slider = $('#new-royalslider-1').data('royalSlider');
slider.ev.on('rsSlideClick', function (event, originalEvent) {
//console.log(this);
$.fancybox( slider.currSlide.bigImage );
});
<?php
}
add_action('new_rs_after_js_init_code', 'add_additional_rs_code');
</div>