I built a webpage with a Parallax feature. I used javascript to disable the text part on small screens, but there is no picture. I want to use JavaScritp to swap the larger picture (1500pixels) for a smaller one(500px). I copied the class in called home, changed the name to mobilehome and added the smaller image. Here is the code javascript:
/* disable paralax scrolling */
var ismobile = /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera
Mini/i.test(navigator.userAgent)
if (ismobile){
// bypass parallax effect
background()
}
//change background pictures
function background () {
var background1 = document.getElementById("home");
background1.target.classlist("mobilehome")};
It doesn't work, any advice?