An open API service indexing awesome lists of open source software.

https://github.com/hardikdabhi/bluroverlay.js

Repo for blur overlay jQuery library
https://github.com/hardikdabhi/bluroverlay.js

blur-backgrounds blurs-elements css html jquery opacity

Last synced: about 2 months ago
JSON representation

Repo for blur overlay jQuery library

Awesome Lists containing this project

README

          

# bluroverlay.js

jQuery plugin that creates an element which blurs elements behind it (background elements). Also provides API to created a blurred modal/mask.
Requires jQuery library.

![Example GIF](http://hardikdabhi.com/projects/bluroverlay.js/img/bluroberlay.js.gif)

[To see live demo click here!](http://www.hardikdabhi.com/projects/bluroverlay.js/demo/)

## Installation

Install using either of below package manager.

* __npm__: `npm install --save bluroverlay.js`
* __bower__: `bower install --save bluroverlay.js`

Or download plugin library directly:

* [Development](https://raw.githubusercontent.com/hardikdabhi/bluroverlay.js/master/dist/bluroverlay.js) (unminified, ~4kb)
* [Production](https://raw.githubusercontent.com/hardikdabhi/bluroverlay.js/master/dist/bluroverlay.min.js) (minified, ~3kb)

## Usage

Basic HTML

```html



... top element html here ...





... your html here ...




```

Script

```js
var blurOverlay = $("#element-id").bluroverlay({
contentWrapperClass: "content-wrapper-class",
blur: "10",
opacity: 0.3,
background: "#fff"
});
```
> Note: CSS needs to be applied as required to make elements fixed on page. Plugin does NOT apply css `position` tag to make any element `fixed` or `absolute`. Download and run demo for example.

## Options

* __contentWrapperClass__ ['content-wrapper'] - Wrapper classname, entire html wrapped within this class will appear blurred when under overlayed element
* __blur__ ['10'] - Amount of blur to be applied
* __opacity__ [0.4] - Opacity of overlayed element
* __background__ ['#fff'] - CSS background applied to overlayed element

> Values mentioned in [] is default for option.

## API

* __showBlurModal(elementId)__

Shows a modal with overlayed element and wrapper elements blurred in background. Pass modal element id in `elementId`.

Modal HTML

```html


Your modal html here



```

Script API

```javascript
blurOverlay.showBlurModal("modal");
```

> Give `name=blurred-modal`. This will hide the modal on init and show it while using this API.

* __hideBlurModal()__

Hides previously shown modal.

```js
blurOverlay.hideBlurModal();
```

## License

[GPL](LICENSE)