Last active
September 6, 2017 04:59
Revisions
-
emaildano revised this gist
Sep 6, 2017 . 1 changed file with 19 additions and 19 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,17 @@ ```html <div class="plan-box"> <div class="dc-table__plans" data-annual-discount="10"> <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">60</span></div> </div> </div> <div class="plan-box"> <div class="dc-table__plans" data-annual-discount="15"> <div class="amimoto-pricing-data" data-monthly="600">$<span class="price">600</span></div> <div class="amimoto-pricing-data" data-monthly="900">$<span class="price">900</span></div> </div> </div> ``` @@ -15,19 +20,14 @@ function percentage(num, per) { return (num/100)*per; } $('.plan-box').each( function() { var discount = $(this).find('.dc-table__plans').data('annual-discount'); $(this).find('.amimoto-pricing-data').each( function() { var annual_full = $(this).data('monthly') * 12; var annual_off = annual_full - percentage(annual_full, discount); $(this).attr('data-annual', annual_off); }); }); ``` -
emaildano revised this gist
Sep 6, 2017 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ ```html <div class="personal" data-annual-discount="10"> <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">60</span></div> </div> <div class="business" data-annual-discount="15"> <div class="amimoto-pricing-data" data-monthly="600">$<span class="price">600</span></div> <div class="amimoto-pricing-data" data-monthly="900">$<span class="price">900</span></div> </div> @@ -16,15 +16,15 @@ function percentage(num, per) { } $('.personal .amimoto-pricing-data').each( function() { var discount = $('.personal').data('annual-discount'); var annual_full = $(this).data('monthly') * 12; var annual_off = annual_full - percentage(annual_full, discount); $(this).attr('data-annual', annual_off); console.log(annual_off); }); $('.business .amimoto-pricing-data').each( function() { var discount = $('.business').data('annual-discount'); var annual_full = $(this).data('monthly') * 12; var annual_off = annual_full - percentage(annual_full, discount); $(this).attr('data-annual', annual_off); -
emaildano revised this gist
Sep 6, 2017 . 1 changed file with 17 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,23 +11,23 @@ ``` ```js function percentage(num, per) { return (num/100)*per; } $('.personal .amimoto-pricing-data').each( function() { var discount = 10; var annual_full = $(this).data('monthly') * 12; var annual_off = annual_full - percentage(annual_full, discount); $(this).attr('data-annual', annual_off); console.log(annual_off); }); $('.business .amimoto-pricing-data').each( function() { var discount = 15; var annual_full = $(this).data('monthly') * 12; var annual_off = annual_full - percentage(annual_full, discount); $(this).attr('data-annual', annual_off); console.log(annual_off); }); ``` -
emaildano revised this gist
Sep 6, 2017 . 1 changed file with 26 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,33 @@ ```html <div class="personal"> <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">60</span></div> </div> <div class="business"> <div class="amimoto-pricing-data" data-monthly="600">$<span class="price">600</span></div> <div class="amimoto-pricing-data" data-monthly="900">$<span class="price">900</span></div> </div> ``` ```js function percentage(num, per) { return (num/100)*per; } $('.personal .amimoto-pricing-data').each( function() { var discount = 10; var annual_full = $(this).data('monthly') * 12; var annual_off = annual_full - percentage(annual_full, discount); $(this).attr('data-annual', annual_off); console.log(annual_off); }); $('.business .amimoto-pricing-data').each( function() { var discount = 15; var annual_full = $(this).data('monthly') * 12; var annual_off = annual_full - percentage(annual_full, discount); $(this).attr('data-annual', annual_off); console.log(annual_off); }); ``` -
emaildano revised this gist
Sep 6, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ ```html <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> ``` ```js $('.amimoto-pricing-data').each( function() { // Percent Off var discount = .1; -
emaildano created this gist
Sep 6, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ ``` <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); }); ```