- Notifications
You must be signed in to change notification settings - Fork2
vue-comps/vue-overlay
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
DEPRECATED seecerijs
To mask out the background when a dialog / modal or similar is opened, a overlay is needed.
- singleton & z-index management to allow stacking
- background doesn't move when scroll gets disabled
npm install --save-dev vue-overlay// vue@1.0npm install --save-dev vue-overlay@1
or includebuild/bundle.js.
overlay=require("vue-overlay")(Vue)# or, when using bundle.jsoverlay=window.vueComps.overlay
For examples seedev/.If you need to reliable get theVue instance, seevue-mixins/vue
zIndex- the z-index of the opened overlay - will be raised by 5 for each overlayclose(callHooks=true)- shortcut foroverlay.close(options,callHooks)- options will be the same instance used for openingOptions
| Name | type | default | description |
|---|---|---|---|
| opacity | Number | 0.5 | opacity of the overlay |
| dismissable | Boolean | true | is the overlay dismissable by click or ESC? |
| onBeforeOpen | Function | null | hook before open animation |
| onOpened | Function | null | hook after open animation |
| onBeforeClose | Function | null | hook before close animation |
| onClosed | Function | null | hook after close animation |
| allowScroll | Boolean | false | don't setoverflow:hidden on body |
| color | String | "black" | background-color of the overlay |
| zIndex | Number | 1000 | minimum zIndex for the new overlay, cannot be lower than 1000 |
optionsthe options object which was used to open a overlaycallHooksset tofalseto suppress the calls ofonBeforeCloseandonClosedof that overlay
overwrite to add a animation
elthedivelement of the overlayopacitythe target opacity of the opening/closingcba function which must be called when finished
vue-overlay is a singleton, so a fade function provided like this, will be used globally.Only do this once:
Velocity=require("velocity-animate")Overlay=require("vue-overlay")Overlay.obj.methods.fade=function({el,opacity,cb}){Velocity(el,{opacity:opacity},{duration:300,queue:false,easing:'easeOutQuad',complete:cb})}
- 2.0.0
now compatible with vue 2.0.0
Clone repository
npm installnpm run dev
Browse tohttp://localhost:8080/.
Copyright (c) 2016 Paul PflugradtLicensed under the MIT license.
About
a simple overlay
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.