cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <div class="container">
  <div class="row">
    <div class="col-sm-12">
        <h1 class="page-header">Responsive, Switiching Price Tables</h1>
    </div>
  </div>
  
    <!--   Pricing Tiles -->
    <section class="pricing-table">
        <div class="container-fluid">
            <div class="row">
                <div class="col-xs-12 col-sm-6 col-md-3">
                    <ul class="pricing-table-tile option-1">
                        <li class="pricing-table-option-1">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h2>Option 1A</h2>
                                </div>
                                <div class="panel-body">
                                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio quisquam magni impedit nihil dolore illum mollitia enim, facere quas esse eos omnis quaerat unde perferendis voluptatem aliquam reiciendis excepturi ipsum.</p>
                                </div>
                            </div>
                        </li>
                        <li class="pricing-table-option-2">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h2>Option 2A</h2>
                                </div>
                                <div class="panel-body">
                                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio quisquam magni impedit nihil dolore illum mollitia enim, facere quas esse eos omnis quaerat unde perferendis voluptatem aliquam reiciendis excepturi ipsum.</p>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="col-xs-12 col-sm-6 col-md-3">
                    <ul class="pricing-table-tile option-1">
                        <li class="pricing-table-option-1">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h2>Option 1B</h2>
                                </div>
                                <div class="panel-body">
                                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio quisquam magni impedit nihil dolore illum mollitia enim, facere quas esse eos omnis quaerat unde perferendis voluptatem aliquam reiciendis excepturi ipsum.</p>
                                </div>
                            </div>
                        </li>
                        <li class="pricing-table-option-2">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h2>Option 2B</h2>
                                </div>
                                <div class="panel-body">
                                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio quisquam magni impedit nihil dolore illum mollitia enim, facere quas esse eos omnis quaerat unde perferendis voluptatem aliquam reiciendis excepturi ipsum.</p>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="col-xs-12 col-sm-6 col-md-3">
                    <ul class="pricing-table-tile option-1">
                        <li class="pricing-table-option-1">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h2>Option 1C</h2>
                                </div>
                                <div class="panel-body">
                                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio quisquam magni impedit nihil dolore illum mollitia enim, facere quas esse eos omnis quaerat unde perferendis voluptatem aliquam reiciendis excepturi ipsum.</p>
                                </div>
                            </div>
                        </li>
                        <li class="pricing-table-option-2">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h2>Option 2C</h2>
                                </div>
                                <div class="panel-body">
                                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio quisquam magni impedit nihil dolore illum mollitia enim, facere quas esse eos omnis quaerat unde perferendis voluptatem aliquam reiciendis excepturi ipsum.</p>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="col-xs-12 col-sm-6 col-md-3">
                    <ul class="pricing-table-tile option-1">
                        <li class="pricing-table-option-1">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h2>Option 1D</h2>
                                </div>
                                <div class="panel-body">
                                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio quisquam magni impedit nihil dolore illum mollitia enim, facere quas esse eos omnis quaerat unde perferendis voluptatem aliquam reiciendis excepturi ipsum.</p>
                                </div>
                            </div>
                        </li>
                        <li class="pricing-table-option-2">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h2>Option 2D</h2>
                                </div>
                                <div class="panel-body">
                                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio quisquam magni impedit nihil dolore illum mollitia enim, facere quas esse eos omnis quaerat unde perferendis voluptatem aliquam reiciendis excepturi ipsum.</p>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        
        <div class="row">
            <div class="col-sm-12">
                <div class="pricing-table-switcher">
                    <p class="fieldset">
				<input type="radio" name="switcher-1" value="monthly" id="option-1" checked>
				<label for="option-1">Option 1</label>
				<input type="radio" name="switcher-1" value="yearly" id="option-2">
				<label for="option-2">Option 2</label>
				<span class="switch"></span>
			</p>
                </div>
            </div>
        </div>
    </section> 
</div>

            
          
!
            
              
.pricing-table-tile {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}
.pricing-table {
    position: relative;
    
    .option-1 .pricing-table-option-1,
    .option-2 .pricing-table-option-2 {
        position: relative;
        z-index:5;
    }
    
    .option-1 .pricing-table-option-2,
    .option-2 .pricing-table-option-1{
          position: absolute;
          top: 0;
          left: 0;
          height: 100%;
          z-index: 1;
    }
}

// Switcher
.pricing-table-switcher {
    text-align: center;
    
    .fieldset {
        display: inline-block;
        position: relative;
        background-color: #235d79;
        padding: 2px;
        border-radius: 50em;
        border: 2px solid black;
    }
    
    input[type="radio"] {
        position: absolute;
        opacity: 0;
    }
    
    label {
        position: relative;
        top: 10px;
        z-index: 1;
        display: inline-block;
        float: left;
        width: 90px;
        height: 40px;
        cursor: pointer;
        font-size: 1.1em;
        color: #fff;
        margin-bottom: 0;
    }
    
    .switch {
        position: absolute;
        top: 2px; 
        left: 2px;
        height: 40px;
        width: 90px;
        background-color: #0c1f28;
        border-radius: 50em;
        -webkit-transition: -webkit-transform 0.5s;
        -moz-transition: -moz-transform 0.5s;
        transition: transform 0.5s;
    }
    
    input[type="radio"]:checked + label + .switch,
    input[type="radio"]:checked + label:nth-of-type(n) + .switch {
        -webkit-transform: translateX(90px);
        -moz-transform: translateX(90px);
        -ms-transform: translateX(90px);
        -o-transform: translateX(90px);
        transform: translateX(90px);
    }
}
            
          
!
            
              $(document).ready(function() {
    var tiles = $('.pricing-table-tile');
    // Pricing Tile JS
    $('.pricing-table-switcher').on('change', function(e) {
        e.preventDefault(); 
        console.log(tiles);
        
        if (tiles.hasClass('option-1')) {
           tiles.removeClass('option-1').addClass('option-2');
        } else {
            tiles.removeClass('option-2').addClass('option-1');
        }
        
    });
});
            
          
!
999px
Loading ..................

Console