小编use*_*098的帖子

以编程方式使用Javascript创建Wave

这是我目前拥有的http://jsfiddle.net/6GEfr/

这有效但我希望它像波浪一样.它应该看起来像一个真正的波浪,而不是'v'形状.你是怎么逐渐这样做的?

var height = 0;

setInterval(function () {
    $('#container').prepend('<div style="height:' + Math.abs(height++) + '%"></div>');
    height = (height == 100) ? -100 : height;
}, 10);
Run Code Online (Sandbox Code Playgroud)

我的css:

html, body, #outerContainer, #container {
    height:100%;
}
#outerContainer {
    display : table;
}
#container {
    display : table-cell;
    vertical-align:bottom;
    white-space:nowrap;
}
#container > div {
    width:5px;
    background:black;
    display:inline-block;
}
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery css3

4
推荐指数
1
解决办法
859
查看次数

标签 统计

css ×1

css3 ×1

html ×1

javascript ×1

jquery ×1