LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
CSS
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700);
@import url("//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css");
/* Red */
*, *:before, *:after {
  box-sizing: border-box;
}

body {
  background: #e0e0e0;
  font-family: 'Open Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
  font-size: 16px;
  color: #555;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.row {
  background: #fff;
  padding: 20px;
  position: relative;
  margin: 0 0 1px 0;
}
.row:hover {
  cursor: pointer;
}
.row.selected {
  background: #f3f3f3;
}

label {
  cursor: pointer;
}
label:before {
  display: inline-block;
  content: "+";
  margin: 0 10px 0 0;
  width: 35px;
  height: 35px;
  border: 3px solid #f95e5e;
  border-radius: 100%;
  vertical-align: middle;
  color: #f95e5e;
  font-size: 30px;
  text-align: center;
  font-weight: 700;
  line-height: 0.9em;
  transition: transform 0.2s ease-in-out;
}

input[type=checkbox]:checked + label:before {
  background: #f95e5e;
  color: #fff;
  transform: rotate(135deg);
  transform-origin: center center;
}

input[type=checkbox] {
  visibility: hidden;
}
JS
// IE9+
$('.row').on('click', function() {
  
   // Clicking on the parent row will toggle the child check box
   $('input[type=checkbox]', this).prop('checked', function(i, checked){
      return !checked
   })

  // Add selected class when box is checked
  if($('input[type=checkbox]', this).prop('checked'))
    $(this).addClass('selected');
  else
    $(this).removeClass('selected');
});
Host Instantly Drag and Drop Website Builder

 

Description

Problem: Style a checkbox that can be used with a shopping cart if you are adding a single item.
Term
Mon, 11/27/2017 - 21:56

Related Codes

Pen ID
Pen ID
Pen ID