猫头鹰旋转木马的高档盒子添加和图像链接
我有一个工作正常的猫头鹰旋转频率,但它只是一个静态的轮旋,我希望它在一个奇特的盒子里,当图像获得单击时,它将用旋转木制喜欢这个
这是我到目前为止我的代码无法根据图像ID将图像链接到URL并与Fancybox添加。
<div class="col-md-5">
<div class="gallery_wrap">
<div id="model-gallery" class="owl-carousel owl-theme">
<?php $featured_image = wp_get_attachment_url( get_post_thumbnail_id(get_the_ID()), 'model-featured-image' );
if($featured_image == ''){
$featured_image = '';
} ?>
<div class="card">
<a data-fancybox="fancyframe" href="<?php echo get_permalink($image_id); ?>">
<img class="card-img-top" src="<?php echo $featured_image; ?>" alt="Card image cap">
</a>
</div>
<?php
$model_images = get_field('gallery');
$image_size = 'full';
if( $model_images ):
foreach( $model_images as $image_id ):?>
<div class="card">
<a data-fancybox="fancyframe" href="<?php echo get_permalink($image_id); ?>">
<img class="card-img-top" src="<?php echo wp_get_attachment_image_url( $image_id, $image_size ); ?>" alt="<?php the_title();?>">
</a>
</div>
<?php endforeach; endif;?>
</div>
</div>
更新:我能够使图像可单击并打开“构想”框,但是当单击图像时,它显示了Fancybox内部的错误:无法加载所需的内容。请重试。
而且,控制台正在显示此错误: unturect typeError:n(...)。附录(...)。hide(...)。fadein不是一个函数 在b.showloading(jquery.fancybox.min.js:11:25512) 在JQUERY.FANCYBOX.MIN.JS:11:20479
I have a Owl carousel which is working fine but it's just a static carousel and I want it to be in a fancy box when an image gets click it'll open up in full size with the carousel exactly like this
Here is my code so far I'm having trouble getting link the images to the urls based on the image ID and add it with fancybox.
<div class="col-md-5">
<div class="gallery_wrap">
<div id="model-gallery" class="owl-carousel owl-theme">
<?php $featured_image = wp_get_attachment_url( get_post_thumbnail_id(get_the_ID()), 'model-featured-image' );
if($featured_image == ''){
$featured_image = '';
} ?>
<div class="card">
<a data-fancybox="fancyframe" href="<?php echo get_permalink($image_id); ?>">
<img class="card-img-top" src="<?php echo $featured_image; ?>" alt="Card image cap">
</a>
</div>
<?php
$model_images = get_field('gallery');
$image_size = 'full';
if( $model_images ):
foreach( $model_images as $image_id ):?>
<div class="card">
<a data-fancybox="fancyframe" href="<?php echo get_permalink($image_id); ?>">
<img class="card-img-top" src="<?php echo wp_get_attachment_image_url( $image_id, $image_size ); ?>" alt="<?php the_title();?>">
</a>
</div>
<?php endforeach; endif;?>
</div>
</div>
UPDATE: I'm able to make the images clickable and open up the fancybox but when an image is clicked it shows the error inside fancybox :The requested content cannot be loaded. Please try again.
Also the console is showing this error:
Uncaught TypeError: n(...).appendTo(...).hide(...).fadeIn is not a function
at b.showLoading (jquery.fancybox.min.js:11:25512)
at jquery.fancybox.min.js:11:20479
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论