Random Wall – jQuery random background image plugin

A simple jQuery random background image plugin – randomly changes background-image of an element.

Random Wall – jQuery random background image sliding

This simple jQuery plugin switches background images of a container randomly and automatically, with a set delay time. For example it can parse a wallpaper webpage and get a url of randomly selected image.

We can set delay_time to change a background-image without a new page load. Otherwise, if we won’t set it, the plugin will only change a background-image only when a page is reloaded.

Random Wall - jQuery random background image solution
Random Wall – jQuery random background image solution

Usage

Include jQuery and Random Wall plugin:

<script src="jquery.min.js"></script>
<script src="jquery.random-wall.min.js"></script>

We also need an element, where a background-image will be changed:

<div id="random-wall" /> </div>

Run the plugin:

$("#random-wall").randomwall({
  delay_time: 0, // default: 0 miliseconds (optional)
});

We can also customize own image links directly:

$("#random-wall").randomwall({
  image_list: ['http://i.imgur.com/CiAvVQL.jpg',
               'http://i.imgur.com/qC5Nprs.jpg',
               'http://i.imgur.com/fckzvp1.jpg',
               'http://i.imgur.com/od4QZ8C.jpg']
});

That’s it! Ready.

License: MIT

Demo:

http://carpedm20.github.io/randomwall

Get jQuery random background image from GitHub:

https://github.com/carpedm20/random-wall

Enjoy!

Share:Share on Facebook2Share on Google+0Tweet about this on TwitterShare on LinkedIn1Pin on Pinterest2