灯箱功能加载URL而不是实际图像

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>
查看全部
dounang1974
dounang1974
2019/05/21 19:03
  • fancybox
  • function
  • php
  • 点赞
  • 收藏
  • 回答
    私信

1个回复