$(window).scroll(function () {
if ($(this).scrollTop() > 150) {
$('.header').addClass('white');
}
else{
$('.header').removeClass("white");
}
});
.white {
background-color: #fff;
color: #000;
}
$(".fag .item").on("click", function (e) {
$(this).find('.answer').toggle('slow');
});
.parent {
width:100%;
}
.child {
display:inline-block;
}
<div class="parent">
<div class="child">child1</div>
<div class="child">child2</div>
<div class="child">child3</div>
</div>
<input type='file' accept='image/*' onchange='openFile(event)'><br>
<img id='output'>
var openFile = function(event) {
var input = event.target;
var reader = new FileReader();
reader.onload = function(){
var dataURL = reader.result;
var output = document.getElementById('output');
output.src = dataURL;
};
reader.readAsDataURL(input.files[0]);
};
#logo {
background:#ccc;
height:50px;
width:100px;
border:1px solid;
}
#logo.s0,#logo.s1,#logo.s2 {
background:#ccc111;
}
#logo.s3,#logo.s4,#logo.s5 {
background:#111ccc;
}
#logo.s6,#logo.s7,#logo.s8 {
background:#c1c1c1;
}
#logo.s9,#logo.s10,#logo.s11 {
background:#1c1c1c;
}
<div id="logo"></div>
var date = new Date();
document.getElementById("logo").classList.add('s'+date.getMonth());