Skip to content

Instantly share code, notes, and snippets.

@emaildano
Last active September 6, 2017 04:59
Show Gist options
  • Save emaildano/c2f9a5c1e838ae2ce2f0c9f6ecd17fde to your computer and use it in GitHub Desktop.
Save emaildano/c2f9a5c1e838ae2ce2f0c9f6ecd17fde to your computer and use it in GitHub Desktop.
Percentage off Month Plans
<div class="amimoto-pricing-data" data-monthly="30">$<span class="price">30</span></div>
<div class="amimoto-pricing-data" data-monthly="60">$<span class="price">30</span></div>
$('.amimoto-pricing-data').each( function() {
  // Percent Off
  var discount = .1;

  var plan_monthly = $(this).data('monthly');
  var plan_annual = plan_monthly * 12;
  var plan_annual_discount = plan_annual * discount;
  var plan_annual = plan_annual - plan_annual_discount;

  console.log(plan_annual);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment