HTML
- 66 ответов
- 0 вопросов
86
Вклад в тег
.wrapper {
width: 100%;
height: 100%;
background: linear-gradient(to right, green 50%, red 50%);
}
<div class="wrapper"></div>
body,html {
width: 100%;
height: 100%;
}
.wrapper {
width: 100%;
height: 100%;
transition: background 1s;
background: none;
}
(function (w, d) {
w.onload = function () {
var wp = d.querySelector('.wrapper'),
colors = ['yellow', 'red', 'green', 'blue'],
ln = colors.length;
var changeColor = function (i) {
if (i < ln) {
setTimeout(function () {
wp.style.cssText = "background: " + colors[i] +";";
i++;
changeColor(i);
}, 2000);
} else {
changeColor(0);
}
};
changeColor(0);
};
}(window, document));
var http = require('http');
var fs = require('fs');
var file = fs.createWriteStream("file.jpg");
var request = http.get("http://test/test.jpg", function(response) {
response.pipe(file);
});