I'm planning to set six different images as fixed background images, and I hope to make it that so different ones would light up at different times as I scroll down the page. But so far, I'm having trouble even just getting the background images to show up. So far I'm planning to set up six of these in styles.css:
#background1 {
background-image: url(img/background1.png);
background-size: auto;
background-repeat: no-repeat;
background-attachment: fixed;
background-position: left;
}
But not a single one of them show up and I don't know why. There's not much else on the rest of the document either, both the html and the css documents.
Also after I've somehow managed to put the background images in place, would I be using Javascript to control the lighting/dimming of the images as I scroll? I'm thinking of something along the lines of this, but I'm not sure if it would work:
$(function() {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$(‘body’).addClass(‘dimBackground’)
}
if ($(this).scrollTop() < 100) {
$(‘body’).removeClass(‘dimBackground’)
}
});
});
I'm really sorry if this is a dumb question, made an account just for question as I'm new to all of this. Thanks so much!