Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. var swiper = new Swiper('.product', {
  2. pagination: '.swiper-pagination',
  3. slidesPerView: 3,
  4. paginationClickable: true,
  5. centeredSlides: true,
  6. freeMode: true,
  7. roundLengths: true,
  8. freeModeSticky: true,
  9. speed: 300,
  10. onSlideChangeEnd:function(){
  11.  
  12.  
  13. swiper.initialSlide = price;
  14. //главная страница
  15. var price = parseInt($('#value .swiper-slide-active').text()); //получение суммы
  16. var days = parseInt($('#days .swiper-slide-active').text()); //получение дней
  17.  
  18. $("#select-price").val(price);
  19. $("#select-day").val(days);
  20.  
  21. var dayRes = dec("дней", "день", "дня", days); //склонение дней
  22. $('#take .calculator-money').html(price+'₴'); //добавление в поле занимаете (суммы)
  23. $('#take .calculator-days').text('На '+ days+ ' '+dayRes); //добавление в поле занимаете (дней)
  24.  
  25. var procent = parseFloat($('.procent').text()); //получение %
  26. var proc = (price / 100) * procent * days;
  27. var result = price + proc;
  28.  
  29. var date = new Date();
  30. var dateMonth = date.getMonth();
  31. var getDate = date.toString();
  32. var getDay = getDate.substr(7,3);
  33.  
  34.  
  35. var date = new Date();
  36. var newDate = addDays(date, days);
  37. var getDay = date.setTime(newDate);
  38. var countDay = date.getDate();
  39. var arrMonth = ['января', 'февраля', 'марта', 'апреля','мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'];
  40.  
  41. $('#give .calculator-money').html(Math.round(result)+'₴'); // добавления результата суммы
  42. $('#give .resul-value').html(Math.round(result)+'₴'); // добавления результата суммы
  43. $('#give .calculator-days').text(countDay +' ' +arrMonth[newDate.getMonth()]+' '+newDate.getFullYear()); // добавления результата дней
  44.  
  45.  
  46.  
  47. //страница регистрации
  48.  
  49. $('#take .loan-sum').html(price+'₴');
  50. $('#give .result-days').text(countDay +' ' +arrMonth[newDate.getMonth()]+' '+newDate.getFullYear());
  51. $('#value-res .resul-value').html(Math.round(result)+'₴');
  52.  
  53. }
  54. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement