Advertisement
bongzilla

Untitled

Jul 4th, 2022
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <script>
  2. $(document).ready(function(e) {
  3. const $moreLinks = $(".js-more-btn");
  4. const $modalForm = $("#form-call");
  5. const $modalTitle = $modalForm.find(".js-modal-title");
  6. const $modalImage = $modalForm.find(".b-image");
  7.  
  8. $moreLinks.on("click", function(e) {
  9. const title = $(this).data("modtitle");
  10. const image = $(this).parents(".b-product-card").find("img")[0].src;
  11.  
  12. $modalTitle.text(title);
  13. $modalImage.attr("src", image);
  14.  
  15. $("<input>").attr({
  16. type: "hidden",
  17. id: "product-type",
  18. name: "С какой формы пришли",
  19. value: title
  20. }).appendTo($modalForm);
  21. })
  22.  
  23. });
  24. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement