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.
Option: src
Pattern image to fill the overlay.
$.vegas('overlay', { src:'/vegas/overlays/4.png' });
Available patterns
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'};
Get
Get the overlay jQuery object.
var overlay = $.vegas('get', 'overlay'};