A page filling slideshow html and javascript only

A while ago I started working on a idea to create a html only website with window filling photos on the background that change just like a slideshow does. Just like the kind of sites you usually see that are made in Flash or Flex.

I looked around for possible solutions on Google and figured that I had to do it myself. Now, based on the code of Scott Robin’s Backstretch plugin I created a small one-line-of-code jquery plugin that does just this.

You can download the plugin from github here.

Preferably the plugin should work on all tablets as well.


A simple jquery plugin based on Scott Robin’s jQuery Backstretch plugin. Create a window filling slideshow in the background with multiple images. Resizes images and maintains aspect ratio.

Just one line of code

Download the code from github

Check the example here


Put this line of code in your html file:

<script src="jquery-backgrounder.js"</script>
    var array_of_urls = [

    $.backgrounder( array_of_urls, options );

That’s it.


There are a few options to configure the plugin to your needs.

var options = {
    transitionTime: 1600, // Amount of time to fade in/out the images.
    displayTime: 5000, // For how long should a photo be displayed.
    centeredX: true, // Should we center the image on the X axis?
    centeredY: true, // Should we center the image on the Y axis?
    zIndex: -666 // z-position of all the images.