bogdan_obukhovskii

Untitled

May 29th, 2020
726
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery(document).ready(function( $ ) {
  2.     let post = $('.pop-n .jet-posts__item');
  3.     let isActive = false;
  4.     let postUrl = $(this).find('a.btn').attr('href');
  5.     let result;
  6.     let header = $(this).find('.entry-title > a').text().substring(0, 70) + "...";  
  7.  
  8.  
  9.     post.click( function(event) {
  10.         result = null;
  11.         event.preventDefault();
  12.        
  13.         $.ajax({
  14.             type: 'POST',
  15.             url: postUrl,
  16.             success: function (res) {
  17.                 result = jQuery.parseJSON(res);
  18.                
  19.                  $('#esket').find('a').trigger('click');
  20.                  
  21.                  start();
  22.             },
  23.             error: function () {
  24.                 alert("error");
  25.             }
  26.         });
  27.      
  28.     });
  29.  
  30.     function start() {
  31.         setTimeout(function() {
  32.             if ( $('#jet-popup-542').hasClass('jet-popup--show-state') ) {
  33.                  alert();
  34.                  $('#jet-popup-542').find('h2').text(header);
  35.                  $('#sp-1').find('.elementor-tab-content').text(result.who);
  36.                  $('#sp-2').find('.elementor-tab-content').text(result.documents);
  37.                  $('#sp-3').find('.elementor-tab-content').text(result.how);
  38.                  $('#sp-4').find('.elementor-tab-content').text(result.where);
  39.              
  40.             } else {
  41.               start();
  42.             }
  43.         }, 2000);
  44.     }
  45. });
Advertisement
Add Comment
Please, Sign In to add comment