Jquery animate的使用方法
js:
$('#colspan').click(function () {
if ($('#colspan').hasClass('glyphicon-chevron-up')) {
$('#colspan').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down');
} else {
$('#colspan').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up');
}
$('#jumbotron').animate({
height: 'toggle'
}, 100);
});
html:
<div id="colspan" class="glyphicon glyphicon-chevron-down">
效果图:



浙公网安备 33010602011771号