Vegas
Background
jQuery Plugin

Documentation

Need help? Hire me!

Design & Development by Jay Salvat, Pictures by Sebastien Israel

Back to the Homepage

Overlay

Most of the time, backgrounds are stretched a lot to fit big screens. An overlay with a texture can be added to mask the image degradation effects. It also adds a stylish look to your backgrounds.

This method is borrowed to the talented guys at Codrops.

$.vegas('overlay');
$.vegas({
  src:'/img/background.jpg'
});

The pattern defined by CSS is taken to fill the overlay.

Click to try

Option: src

Pattern image to fill the overlay.

$.vegas('overlay', {
  src:'/vegas/overlays/4.png'
});

Click to try

Available patterns

Click to try

Option: Opacity

Opacity of the overlay.

$.vegas('overlay', {
  opacity:0.5
});

Destroy

Remove background and overlay completely.

$.vegas('destroy');

Add overlay as an option in order to remove the overlay:

$.vegas('destroy', 'overlay');

Add background as an option in order to remove the background but keep the overlay.

$.vegas('destroy', 'background');

Click to try

Get

Get the overlay jQuery object.

var overlay = $.vegas('get', 'overlay');