<input id="bodybg" type="color">
<script>
document.getElementById('bodybg').onchange = function () {
document.body.style.backgroundColor = this.value;
}
</script>
<style>
.logo, .logo2 {width: 100px; height: 100px;}
.logo {background: green;}
.logo2 {background: blue;}
</style>
<div class="logo"></div>
<div class="logo"></div>
<div class="logo"></div>
<script>
setInterval(function() {
var fl = document.querySelector('.logo'),
fn = fl ? 'logo' : 'logo2';
cn = fl ? 'logo2' : 'logo';
console.log(fl, fn, cn);
document.querySelectorAll('.'+fn).forEach(function(i) {
i.className = cn;
console.log(i.className);
});
}, 5000);
</script>
$('#vk-next').click(function(){
$('#vk-next').show();
var albumID = ['$OTHER5$'];
$.each(albumID, function(i, item){
albumID = item.split('_');
OfsetIMG = $('div#gr-photo span').html();
if(OfsetIMG == '0') { OfsetIMG = '1';};
$.ajax({
url: "https://api.vk.com/method/photos.get?owner_id=-"+albumID[0]+"&album_id="+albumID[1]+"&v=3&count=20&offset="+OfsetIMG+"&callback",
dataType: "jsonp",
cache: false,
success: function(data) {
if(!data.response.length) {
$('#vk-next').hide();
} else {
data.response.forEach(function(item) {
var img = item.src_xxxbig;
(!(img)) ? img = item.src_big : img;
$('.vk-album').append('<img src="'+img+'" alt="" />');
var numPhoto = $('div#gr-photo img').size();
$("div#gr-photo span").html(numPhoto);
});
}
} }); }); });
var response = [
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "Sincere@april.biz",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough",
"zipcode": "92998-3874",
"geo": {
"lat": "-37.3159",
"lng": "81.1496"
}
},
"phone": "1-770-736-8031 x56442",
"website": "hildegard.org",
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net",
"bs": "harness real-time e-markets"
}
},
{
"id": 2,
"name": "Ervin Howell",
"username": "Antonette",
"email": "Shanna@melissa.tv",
"address": {
"street": "Victor Plains",
"suite": "Suite 879",
"city": "Wisokyburgh",
"zipcode": "90566-7771",
"geo": {
"lat": "-43.9509",
"lng": "-34.4618"
}
},
"phone": "010-692-6593 x09125",
"website": "anastasia.net",
"company": {
"name": "Deckow-Crist",
"catchPhrase": "Proactive didactic contingency",
"bs": "synergize scalable supply-chains"
}
}
];
response.forEach(function(i) {
console.log(Object.keys(i));
});
<textarea rows="8" cols="40" id="area">Кликни меня
</textarea>
<script>
area.onmousedown = function(e) { this.value += "mousedown\n";};
area.onmouseup = function(e) { this.value += "mouseup\n";};
area.onclick = function(e) { this.value += "click\n"; this.scrollTop = this.scrollHeight; };
</script>