Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //1
- if (window.location.search.indexOf('no-cf-resize') < 0) {
- $('.cf-resize-2 .image img').each(function() {
- var src = $(this).attr('data-src');
- var resize2 = $(".row").find("cf-resize-2");
- var datasrcResize2 =
- ((typeof resize2 !== typeof undefined && resize2 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=280,quality=75/') + ' 360w,' : '') +
- ((typeof resize2 !== typeof undefined && resize2 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=600,quality=75/') + ' 640w,' : '') +
- ((typeof resize2 !== typeof undefined && resize2 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=405,quality=75/') + ' 960w,' : '');
- $(this).attr('data-srcset', datasrcResize2.substring(0, datasrcResize2.length - 1));
- });
- $('.cf-resize-3 .image img').each(function() {
- var src = $(this).attr('data-src');
- var resize3 = $(".row").find("cf-resize-3");
- $(this).attr('data-srcset', datasrcResize3.substring(0, datasrcResize3.length - 1));
- var datasrcResize3 =
- ((typeof resize3 !== typeof undefined && resize3 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=280,quality=75/') + ' 360w,' : '') +
- ((typeof resize3 !== typeof undefined && resize3 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=600,quality=75/') + ' 640w,' : '') +
- ((typeof resize3 !== typeof undefined && resize3 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=280,quality=75/') + ' 960w,' : '');
- $(this).attr('data-srcset', datasrcResize3.substring(0, datasrcResize3.length - 1));
- });
- $('.cf-resize-4 .image img').each(function() {
- var src = $(this).attr('data-src');
- var resize4 = $(".row").find("cf-resize-4");
- var datasrcResize4 =
- ((typeof resize4 !== typeof undefined && resize4 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=280,quality=75/') + ' 360w,' : '') +
- ((typeof resize4 !== typeof undefined && resize4 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=600,quality=75/') + ' 640w,' : '') +
- ((typeof resize4 !== typeof undefined && resize4 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=200,quality=75/') + ' 960w,' : '');
- $(this).attr('data-srcset', datasrcResize4.substring(0, datasrcResize4.length - 1));
- });
- }
- //2 Not working
- if (window.location.search.indexOf('no-cf-resize') < 0) {
- var src = $(this).attr('data-src');
- var resize2 = $(".row").find("cf-resize-2");
- var datasrcResize2 =
- ((typeof resize2 !== typeof undefined && resize2 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=280,quality=75/') + ' 360w,' : '') +
- ((typeof resize2 !== typeof undefined && resize2 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=600,quality=75/') + ' 640w,' : '') +
- ((typeof resize2 !== typeof undefined && resize2 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=405,quality=75/') + ' 960w,' : '');
- $('.cf-resize-2 .image img').each(function() {
- $(this).attr('data-srcset', datasrcResize2.substring(0, datasrcResize2.length - 1));
- });
- $('.cf-resize-3 .image img').each(function() {
- $(this).attr('data-srcset', datasrcResize3.substring(0, datasrcResize3.length - 1));
- });
- $('.cf-resize-4 .image img').each(function() {
- $(this).attr('data-srcset', datasrcResize4.substring(0, datasrcResize4.length - 1));
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement