list.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. (function ($) {
  2. "use strict";
  3. /*--/ Star Typed /--*/
  4. if ($('.text-slider').length == 1) {
  5. var typed_strings = $('.text-slider-items').text();
  6. var typed = new Typed('.text-slider', {
  7. strings: typed_strings.split(','),
  8. typeSpeed: 80,
  9. loop: true,
  10. backDelay: 1100,
  11. backSpeed: 30
  12. });
  13. }
  14. function initParallax() {
  15. $('#masthead').parallax("100%", 0.3);
  16. $('#content').parallax("20%", 0.7);
  17. }
  18. initParallax();
  19. let counter;
  20. counter = 0;
  21. $(window).scroll(function () {
  22. if ($(window).scrollTop() + $(window).height() == $(document).height()) {
  23. function see_more() {
  24. counter = counter + 10;
  25. var csrftoken = $.cookie('csrftoken')
  26. let info;
  27. info = {'counter': counter, 'csrfmiddlewaretoken': csrftoken}
  28. $.ajax({
  29. type: "POST",
  30. url: 'article/article_list_call/',
  31. data: info,
  32. datatype: 'json',
  33. headers: {"X-CSRFToken": csrftoken},
  34. success: function (data) {
  35. console.log(data)
  36. $("#articles_list").append(data);
  37. }
  38. })
  39. }
  40. see_more();
  41. }
  42. })
  43. })(jQuery);