flip card

by Ivin Raj S

HTML

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<br>
<br>
<br>
<br>
<div class="container">
    <div class="flip">
        <div class="moveOnchange card">
            <div class="face front bgGrey">
                <div class=" portlet portletTodelete  ">
                    <div class="portlet-header"> <span class="  "> Front Side </span>

                        <div class="dropdown pull-right "> 
                  
                            <span class="pull-right ">
                            <span class="flipControl" >Edit &nbsp;<span class="glyphicon glyphicon-pencil pull-right flipLink"> </span> </span>
                            </span>
                        </div>
                        <!-- portlet-content -->
                    </div>
                    <!-- portlet-header -->
                </div>
                <div class="portlet-content1">content</div>
                <!-- portlet- -->
                
            </div>
            <!-- moveOnchange-->
            <div class="face back">
                <div class="inner">
                    <div class="portlet">
                        <div class="flipForm bgGrey">          Back Side
                            <ul class="list-inline pull-right ">
                                <li class="flipControl"> <span class="pull-right glyphicon glyphicon-floppy-disk gi-1x opacity7 "></span>

                                </li>
                            </ul>
                            <hr class="hrflipForm">
                        </div>
                        <!-- Header Closed -->
                        <div class="portlet-content">
                            <br>text
                            <br>text
                            <br>text
                            <br>text
                            <br>text
                          ...

CSS

.flipForm {
        padding:5px;
    }
 
    .bgGrey {
        background: #efefef;
    }

    .portlet {
        border:solid 1px red;
        padding: 10px;
    }
    
.portlet-header {
        padding: 0.2em 0.3em;
        /*margin-bottom: 0.5em;*/
        position: relative;
    }

    .portlet-content {
        border:blue 1px solid;
        padding: 0.4em;
        min-height: 400px;
    }
 .portlet-content1 {
        border:blue 1px solid;
        padding: 0.4em;
        min-height: 450px;
    }

    .portlet-placeholder {
        border: 1px dotted black;
        margin: 0 0 10px 0;
        height: 50px;
    }



    /************* Flip and show Form. ************/

    .flip {
        -webkit-perspective: 800;
        perspective: 800;
        position: relative;
        min-height: 450px;
        margin-bottom: 30px;
    }

    .flip .card.flipped {
        -webkit-transform: rotatey(-180deg);
        transform: rotatey(-180deg);

    }

    .flip .card {
        -webkit-transform-style: preserve-3d;
        -webkit-transition: 0.5s;
        transform-style: preserve-3d;
        transition: 0.5s;
    }

    .flip .card .face {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        z-index: 2;
        height: 100%;

    }

    .flip .card .front {
        position: absolute;
        width: 100%;
        z-index: 1;
        height: auto;
    }

    .flip .card .back {
        height: auto;
        -webkit-transform: rotatey(-180deg);
        transform: rotatey(-180deg);
    }

    .inner {
        height: auto !important;
        margin: 0px !important;
    }

    .container2 {
        border:solid 1px green;
        height:50px;
        padding:5px;
       margin-top:-20px;
        
    }

JavaScript

$('.flipControl').on('click', function () {
     $(this).closest('.card').toggleClass('flipped');
 });