jquery动画效果和rgb应用什么的

Posted incredible-x

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jquery动画效果和rgb应用什么的相关的知识,希望对你有一定的参考价值。

var rgb = $b.css("background-color");
    console.log(rgb);
    var list = new Array();
    var s = rgb.replace(/rgb((d{1,3}),s*(d{1,3}),s*(d{1,3}))/, "$1+$2+$3");
    console.log(s);
    list = s.split(‘+‘);
    console.log(list);
    for(var i = 0; i < list.length; i++)
    {
        list[i]=parseInt(list[i]) + 10;
    }
    console.log(list);
    $b.css("background-color", "rgb("+list[0]+","+list[1]+","+list[2]+‘)‘);

上面是根据正则表达式从css中的background-color提取rgb

并且改变rgb

 

 

jQuery 自带的animate的高级用法

一般是直接用花括号写一些要改变的东西

$b.animate(
        {width: "+=80px"}, 
        {duration:1000, 
        step: function(){
            $(this).css("height", function(){
                return parseInt($(this).css("height"))+1;
            });
        }
    }
    )

现在还没什么意思,待更新

 

以上是关于jquery动画效果和rgb应用什么的的主要内容,如果未能解决你的问题,请参考以下文章