flippant-js
v1.1.2
Published
A mini dependency-less UI lib for flipping over DOM nodes
Downloads
1
Readme
flippant-js
Please Note:
This fork was made to solve some issues I was having with this plugin, and may not work for you. Feel free to use it if you want, just know that I won't necessarily address any issues that arise with it.
Description:
- Flippant has a single function:
flippant.flip()
. Use it to flip things. - There are two modes:
card
(the default), andmodal
. - The back gets the default class of
.flippant-modal-dark
for modals and.flippant-modal-light
for cards. These styles can be overridden or you can pass in your own additional class. - Most of the magic is in the css file. Override however you'd like
Example:
var front = document.getElementById('flipthis');
var back_content = "<h1>I'm the back!</h1>"; // Generate or pull any HTML you want for the back.
var back;
// to flip
back = flippant.flip(front, back_content) // flip(element_to_flip, content_for_back, type(modal/card), extra_class_for_back)
// to close (i.e. to flip back)
back.close()