yemM / flippy

Flippy is a cross-browser flip effect plugin for jQuery which allows you to flip whatever html element you want. It now supports rgba colors
140 stars 98 forks source link

Flippy jQuery Plugin

Demo

view the Demo

Features

Options

Markup

<div class="flipbox-container">

    <div id="myFlippyBox">
        <span>Hello !</span>
    </div>

</div>

Example

$("#myFlippyBox").flippy({
    verso:"Hi !",
    direction:"TOP",
    duration:"750",
    onStart:function(){
        alert("Let's flip");
    },
    onFinish:function(){
        alert("ok, it's flipped :)");
    }
});

// If you want to revert the last animation
$("#myFlippyBox").flippyReverse();

Example noRemove

Setting noRemove to true prevents Flippy from injecting elements into the DOM as well as using remove. This is useful for elements with event bindings that can be lost when removed from the DOM.

When using noRemove, verso and recto have different purposes. Instead of holding the content to inject into the DOM, verso and recto represent a selector of the content to be flipped to and the currently displayed content.

If the element that verso points to exists already, backhtml does not re-inject content.

$("#myFlippyBox").flippy({
  verso:"#backSide",
  recto:"#frontSide",
  backhtml: "<div id='backSide'>Hello</div>"
  noRemove: true,
  direction:"TOP",
  duration:"750",
  onStart:function(){
    alert("Let's flip");
  },
  onFinish:function(){
    alert("ok, it's flipped :)");
  }
});

// If you want to revert the last animation
$("#myFlippyBox").flippyReverse();

Licence

Released under the MIT license