这里您使用了虚拟图像,但可以看到结果。滑块工作正常。https://www.risingwebstars.com/video.webm 上面的代码有两个错误,所以请使用下面的代码。
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="owl-carousel" id="product-slider">
<?php $loop = new wp_Query(array(
\'post_type\' => \'home_producten\',
\'orderby\' => \'ID\',
\'order\' => \'ASC\',
)); ?>
<?php while ($loop->have_posts()): $loop->the_post(); ?>
<div class="product">
<?php if(has_post_thumbnail()){ the_post_thumbnail(); } ?>
<h3 class="title">
<?php the_title(); ?>
</h3>
<p class="description">
<?php the_content(); ?>
</p>
<a class="btn btn-warning text-uppercase" href="<?php the_permalink(); ?>"> See More </a> </div>
<?php endwhile;?>
</div>
</div>
</div>
</div>
使用下面的脚本,因为我在此脚本中发现了一个问题
jsfiddle.net/Youssef_X/omfLuk82/15<script type="text/javascript">
jQuery(document).ready(function () {
jQuery("#product-slider").owlCarousel({
loop: true,
items: 3,
itemsDesktop: [1000, 3],
itemsDesktopSmall: [979, 2],
itemsTablet: [768, 2],
itemsMobile: [650, 1],
margin: 10,
nav: true,
autoPlay: true,
dots: false,
autoHeight: false,
});
});
</script>