Guest User

Untitled

a guest
Nov 26th, 2020
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. <div class="catcarusel">
  2. <div id="carousel" class="owl-carousel" style="position: absolute;">
  3. <?php foreach ($categories as $category) { ?>
  4. <div class="item text-center" id="path=<?php echo $category['category_id']; ?>" data-hash="path=<?php echo $category['category_id']; ?>">
  5. <a href="<?php echo $category['href']; ?>" class="list-group-item active"><img src="<?php echo $category['img']; ?>"><div class="catrod"><?php echo $category['name']; ?></div></a>
  6. <div class="block">
  7. <div class="hide">
  8. <svg width="10" height="4" viewBox="0 0 10 4" fill="none">
  9. <path d="M0 0H10L5 4L0 0Z" fill="#370A04"/>
  10. </svg>
  11. </div>
  12. <div class="extremum-slide">
  13. <?php if ($category['children']) { ?>
  14. <?php foreach ($category['children'] as $child) { ?>
  15. <?php if ($child['category_id'] == $child_id) { ?>
  16. <a href="<?php echo $child['href']; ?>" class="list-group-item active"><?php echo $child['name']; ?></a>
  17. <?php } else { ?>
  18. <a href="<?php echo $child['href']; ?>" class="list-group-item"><?php echo $child['name']; ?></a>
  19. <?php } ?>
  20. <?php } ?>
  21. <?php } ?>
  22. </div>
  23. </div>
  24. </div>
  25. <?php } ?>
  26. <div class="item text-center"><a href="https://product.yesdostavka.ru/" class="list-group-item"><svg width="75" height="75" viewBox="0 0 75 75" fill="none">
  27. <rect width="75" height="75" rx="50" fill="#4AC82B"/>
  28. </svg><div class="catrod">Магазин продуктов</div></a></div>
  29. </div>
  30. </div>
  31.  
  32.  
  33. <script type="text/javascript"><!--
  34. $(function() {
  35. var owl = $(".owl-carousel");
  36. owl.owlCarousel({
  37. items: 9,
  38. nav: true,
  39. navText: ['<svg width="31" height="64" viewBox="0 0 31 64" fill="none"><path d="M29.9468 55.9303C31.6421 58.11 31.2494 61.2514 29.0697 62.9468C26.89 64.6421 23.7486 64.2494 22.0532 62.0697L29.9468 55.9303ZM5 32L1.05324 35.0697C-0.35108 33.2642 -0.35108 30.7358 1.05324 28.9303L5 32ZM22.0532 1.93029C23.7486 -0.249439 26.89 -0.642113 29.0697 1.05324C31.2494 2.74859 31.6421 5.88996 29.9468 8.0697L22.0532 1.93029ZM22.0532 62.0697L1.05324 35.0697L8.94676 28.9303L29.9468 55.9303L22.0532 62.0697ZM1.05324 28.9303L22.0532 1.93029L29.9468 8.0697L8.94676 35.0697L1.05324 28.9303Z" fill="#FAF5F0"/></svg>', '<svg width="31" height="64" viewBox="0 0 31 64" fill="none"><path d="M1.05324 55.9303C-0.642111 58.11 -0.249439 61.2514 1.9303 62.9468C4.11003 64.6421 7.25141 64.2494 8.94676 62.0697L1.05324 55.9303ZM26 32L29.9468 35.0697C31.3511 33.2642 31.3511 30.7358 29.9468 28.9303L26 32ZM8.94676 1.93029C7.25141 -0.249439 4.11003 -0.642113 1.9303 1.05324C-0.249438 2.74859 -0.642111 5.88996 1.05324 8.0697L8.94676 1.93029ZM8.94676 62.0697L29.9468 35.0697L22.0532 28.9303L1.05324 55.9303L8.94676 62.0697ZM29.9468 28.9303L8.94676 1.93029L1.05324 8.0697L22.0532 35.0697L29.9468 28.9303Z" fill="#FAF5F0"/></svg>'],
  40. pagination: false,
  41. loop: true,
  42. center: true,
  43. scrollPerPage: true,
  44. callbacks: true,
  45. margin: 10,
  46. startPosition: 'path=<?php echo $category['category_id']; ?>',
  47. slideBy: 1,
  48. autoplayHoverPause: true,
  49. })}).on('click', '.owl-item', function(e) {
  50. const carousel = $('.owl-carousel').data('owl.carousel');
  51. carousel.to(carousel.relative($(this).index()), false, true);
  52. owl.trigger("to.owl.carousel", i);
  53. });
  54.  
  55. --></script>
  56.  
  57. <script>
  58. $(document).click( function(event){
  59. if( $(event.target).closest(".extremum-slide"))
  60. return;
  61. $(".extremum-slide").slideUp("slow");
  62. event.stopPropagation();
  63. });
  64. $('.hide').click( function() {
  65. $(this).siblings(".extremum-slide").slideToggle("slow");
  66. return false;
  67. });
  68. </script>
Advertisement
Add Comment
Please, Sign In to add comment