fauzanjeg

Fix Image Thumnbail to Cropping || For Module 27 in Page

Aug 30th, 2021 (edited)
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.50 KB | None | 0 0
  1. /* Fix Image Thumnbail to Cropping || For Module 27 in Page */
  2. (function ($) {
  3.     $(window).ready(function () {
  4.         var img = $('.page-template .container .jeg_postblock_27 .jeg_post img');
  5.         $.map(img, function (n) {
  6.             var src = $(n).attr('data-srcset').split(',');
  7.             src = src[0].split('350w');
  8.  
  9.             var replace = src[0].replace(/-350x250/g, '');
  10.             $(n).attr('src', replace);
  11.             $(n).attr('data-src', replace);
  12.             $(n).attr('data-srcset', replace);
  13.             $(n).attr('srcset', replace);
  14.         })
  15.     })
  16. })(jQuery);
Add Comment
Please, Sign In to add comment