我是 CakePHP 的新手,目前在一个需要 bxsldier 的网站工作。我使用以下代码导入脚本:
echo $this->Html->script('http://code.jquery.com/jquery-1.9.1.min.js');
echo $this->Html->script('http://code.jquery.com/jquery-migrate- 1.1.1.min.js');
echo $this->Html->script('jquery-1.9.0.min');
echo $this->Html->script('jquery');
echo $this->Html->script('bootstrap');
echo $this->Html->script('jquery.nivo.slider');
echo $this->Html->script('jquery.bxslider');
echo $this->Html->script('site');
脚本:$(document).ready(function(){
$('.bxslider').bxSlider({ minSlides: 1, maxSlides: 4, slideWidth: 239, slideMargin: 0, pager: false }); });
和 HTML:
<ul class="bxslider">
<li>
<div class="bxImg">
<?php echo $this->Html->image('test-pic.png'); ?>
</div>
<div>
<span>"</span>Porttitor pulvinar, odio, voluptatem laboriosam, ornare, eius ab neque saepe, platea aut dolore, mus. Eligendi aliquip!
</div>
<div class="bxPerson">
By Thomas Longbottom
</div>
</li>
<li>
<div class="bxImg">
<?php echo $this->Html->image('test-pic.png'); ?>
</div>
<div>
<span>"</span>Porttitor pulvinar, odio, voluptatem laboriosam, ornare, eius ab neque saepe, platea aut dolore, mus. Eligendi aliquip!
</div>
<div class="bxPerson">
By Thomas Longbottom
</div>
</li>
<li>
<div class="bxImg">
<?php echo $this->Html->image('test-pic.png'); ?>
</div>
<div>
<span>"</span>Porttitor pulvinar, odio, voluptatem laboriosam, ornare, eius ab neque saepe, platea aut dolore, mus. Eligendi aliquip!
</div>
<div class="bxPerson">
By Thomas Longbottom
</div>
</li>
<li>
<div class="bxImg">
<?php echo $this->Html->image('test-pic.png'); ?>
</div>
<div>
<span>"</span>Porttitor pulvinar, odio, voluptatem laboriosam, ornare, eius ab neque saepe, platea aut dolore, mus. Eligendi aliquip!
</div>
<div class="bxPerson">
By Thomas Longbottom
</div>
</li>
<li>
<div class="bxImg">
<?php echo $this->Html->image('test-pic.png'); ?>
</div>
<div>
<span>"</span>Porttitor pulvinar, odio, voluptatem laboriosam, ornare, eius ab neque saepe, platea aut dolore, mus. Eligendi aliquip!
</div>
<div class="bxPerson">
By Thomas Longbottom
</div>
</li>
<li>
<div class="bxImg">
<?php echo $this->Html->image('test-pic.png'); ?>
</div>
<div>
<span>"</span>Porttitor pulvinar, odio, voluptatem laboriosam, ornare, eius ab neque saepe, platea aut dolore, mus. Eligendi aliquip!
</div>
<div class="bxPerson">
By Thomas Longbottom
</div>
</li>
</ul>
结果是加载了内容但脚本没有运行。关于如何使其运行的任何建议?