Skip to content

Repository files navigation

flipbox

Double-sided flip box using css transformations.

Installation

$ component install component/flipbox

Example

<divid="card"><div><div>front</div><div>back</div></div></div><script>varcard=document.querySelector('#card');varFlipbox=require('flipbox');varbox=newFlipbox(card);box.el.onclick=function(){box.flip();};</script>

API

Flipbox(el)

Initialize a Flipbox with the given container el. Inside this should be a wrapper div, within that should be the two faces. View ./example.html for a full example.

Flipbox#flip()

Toggle the visibile face.

Flipbox#front()

Show the front face.

Flipbox#back()

Show the back face.

License

MIT

About

Double-sided flip box using css transformations.

Resources

Stars

14 stars

Watchers

6 watching

Forks

Releases

Packages

Contributors

Languages