Answers for "how can we change background in loop img in webpages"

0

how can we change background in loop img in webpages

var box = document.getElementById('box'),
imgs = ['/image.jpg', '/image2.jpg'];

box.onclick = function () {
img = imgs.shift();
imgs.push(img);

box.style.backgroundImage = img;
};
Posted by: Guest on July-28-2021
0

how can we change background in loop img in webpages

<div id='box'></div>
Posted by: Guest on July-28-2021
0

how can we change background in loop img in webpages

#box {
background: url("https://priteshgupta.com/wp-content/uploads/2011/06/html-ipsum.png");
width:200px;
height:200px;
margin:50px;
}
Posted by: Guest on July-28-2021

Code answers related to "how can we change background in loop img in webpages"

Code answers related to "Javascript"

Browse Popular Code Answers by Language