0
我只是想控制导航的位置。我的HTML看起来像这样:如何将Owl Carousel的导航移动到默认div之外?
<!-- Testimonials -->
<?php if(have_rows('testimonials')): ?>
<div class="testimonial-header">
<h5>Testimonials</h5>
<div class="testimonial-controls owl-theme">
<div class="owl-controls">
<div id="customNav" class="owl-nav"></div>
</div>
</div><!-- end testimonial-controls -->
</div><!-- end testimonial-header -->
<div class="owl-carousel owl-theme testimonials">
<?php while(have_rows('testimonials')): the_row();
// vars
$testimonial = get_sub_field('testimonial');
$author = get_sub_field('author');
?>
<div class="testimonial-item">
<?php if($testimonial): ?>
<div class="testimonial-message">
<?php echo $testimonial; ?>
</div>
<div class="testimonial-author">
<p><?php echo $author; ?></p>
</div>
<?php endif; ?>
</div>
<?php endwhile; ?>
</div> <!-- end testimonials -->
<?php endif; ?>
而且我的JavaScript看起来像这样:
$('.testimonials').owlCarousel({
items: 1,
loop:false,
margin:0,
nav:true,
navContainer: '#customNav',
navText: [],
dots: false,
});
然而,在前端,我没有看到我的导航。我也使用最新版本的猫头鹰旋转木马。
我更新了我的OP显示所有的东西我确实有。我试图简化它,因为一旦我被告知只显示相关的代码。报价错误实际上不在我的代码中。我试着复制你的'navText',因为这是我在脚本中看到的唯一不同的东西。 –
我把你的代码粘贴到我的文件中,我仍然无法让按钮出现在代码片段中。很奇怪... –