jQuery特殊效果
// $('.box').fadeOut();//淡出
// $('.box').fadeIn();//淡入
// $('.box').fadeTogggle();//淡入
$('.box').hide();//隐藏
// $('.box').show();//显示
// $('.box').togggle();//显示隐藏
//
// $('.box').slideDown();//下展
// $('.box').slideUp();//上收
// $('.box').slideTogggle();//上收下展
jQuery动画
<script type="text/javascript" src="../js/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
$(function(){
$('#div1').animate({
width:200,
height:200,
},1000,function () {
// alert('动画完了');
$(this).animate({marginLeft:500})
});// 默认值swing两边慢中间快 linear 匀速
})
</script>
jQuery循环
<script type="text/javascript" src="../js/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
$(function(){
$(function () {
$('.list li').html('111').css({
backgroundColor:green});
$('.list li').each(function (index){//each相当于for循环 index是索引
// alert(index);
$(this).html(index);
})
})
})
</script>