dounang1974 2019-05-21 19:03
浏览 128

灯箱功能加载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>
  • 写回答

1条回答 默认 最新

  • dsfsfsfsfs55656 2019-05-22 05:28
    关注

    Without seeing your code, I guess you are missing href or data-src atrributes that indicate source of the content. As the result, the script assumes you want to display your element (in your case - your image).

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!