Guest User

Untitled

a guest
Dec 17th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. function ajaxLoadVideo(params)
  2. {
  3. $('#categoryDataList').show();
  4. $('#blogIndex').hide();
  5. $('#videoList').removeClass('blog-slider');
  6. $.ajax({
  7. url: '/api/test',
  8. method: 'GET',
  9. data: params,
  10. dataType: 'json',
  11. success: function(res) {
  12. $('#categoryDataList .group-heading h3 a').empty().html(res.category.name);
  13. $('#categoryDataList .group-desc').empty().html(res.category.desc);
  14. var _listHTML = '';
  15. videos = res.videos;
  16. for (i = 0; i < videos.length; i++) {
  17. _listHTML += '<div class="blog-item">';
  18. _listHTML += '<div class="blog-image">';
  19. _listHTML += '<a href="/blog/' + videos[i].slug + '" title="' + videos[i].video_title + '">';
  20. _listHTML += '<img alt="' + videos[i].video_title + '" src="/uploads/thumbnail/320_' + videos[i].video_picture + '">';
  21. _listHTML += '</a>';
  22. _listHTML += '</div>';
  23. _listHTML += '<div class="caption">';
  24. _listHTML += '<a class="blog-list-video-title" href="/blog/' + videos[i].slug + '" title="' + videos[i].video_title + '">' + videos[i].video_title;
  25. _listHTML += '</a>';
  26. _listHTML += '</div>';
  27. _listHTML += '<div class="blog-metas">';
  28. _listHTML += '<span class="blog-views">' + addCommas(videos[i].video_koview) + ' views</span>';
  29. _listHTML += '</div>';
  30. _listHTML += '</div>';
  31. }
  32.  
  33. $('#videoList').empty().html(_listHTML);
  34.  
  35. var owl = $("#videoList");
  36. owl.owlCarousel({
  37. loop:false,
  38. navRewind:false,
  39. margin:10,
  40. nav:true,
  41. dots:false,
  42. navText: '',
  43. responsive:{
  44. 0:{
  45. items:1
  46. },
  47. 600:{
  48. items:3
  49. },
  50. 1000:{
  51. items:5
  52. }
  53. }
  54. });
  55. $('#videoList').addClass('blog-slider');
  56.  
  57. }
  58. });
  59. }
Add Comment
Please, Sign In to add comment