我曾经$(document).ready
加载脚本:
$(document).ready(function (){
$('.flexslider').flexslider({
animation: 'fade',
controlsContainer: '.flexslider'
});
});
接下来我想通过按钮更改选项“动画”:
<div class="container span12 menu">
<a id="link-fade" class="menubtn" href="#">FADE</a>
<a id="link-slide" class="menubtn" href="#">SLIDE</a>
</div>
但这不起作用:
$(document).ready(function (){
$('#link-fade').click(function(){
$('.flexslider').flexslider({
animation: 'fade',
controlsContainer: '.flexslider'
});
return false;
});
$('#link-slide').click(function(){
$('.flexslider').flexslider({
animation: 'slide',
controlsContainer: '.flexslider'
});
return false;
});
});