My theme uses this hardcoded code: <div class="x-bg-layer-lower-image" style=" background-image: url(https://www.example.com/home1.jpg); background-repeat: no-repeat; background-position: center; background-size: cover;"></div> HTML: I am looking to fadeout the background image as defined above and fadein a new image after 5 seconds. This loop should repeat every 5 seconds with additional images. Is this possible using Jquery?
Adapt this for the timing sequence <button onclick="setTimeout(myFunction, 3000)">Try it</button> <script> function myFunction() { alert('Hello'); } </script> Code (JavaScript): and this for the fade in - so that it's not triggered by a button but by the timeout callback <button id="fade-in">Fade In</button> <button id="fade-out">Fade Out</button> <button id="toggle-fading">Toggle Fading</button> <img src="logo.png" alt="logo"> <script> $('#fade-in').click(function(){ $('img').fadeIn('fast'); }); $('#fade-out').click(function(){ $('img').fadeOut(400); }); </script> </body> </html> Code (JavaScript):