jquery的animate函数详解

来源:互联网 发布:java框架怎么用 编辑:程序博客网 时间:2024/05/16 01:38

                function small()
                {
                
                        
                    $("#one").animate({
                        width:'80px',
                        height:'80px',
                        marginTop:'235px'
                    },"normal",big);
        
                }
            
            
            function big()
                {
                
                    $("#one").animate({
                        width:'200px',
                        height:'200px',
                        marginTop:'175px'
                    },"normal",small);

                }

small();

这是一段实现来回变化的代码

animate({


css属性:'css值',

css属性:'css值',

css属性:'css值'


},[speed],[callback])

1 其中css属性是margin-top这一类的时候要改成marginTop这种格式

2 speed 可以用毫秒为单位的时间或者是'slow','fast',‘nomal’这一类的但是注意要加引号

3 最后的回调函数,是直接写函数名而不是small();括号不需要


0 0
原创粉丝点击