<script src="https://code.jquery.com/jquery-3.5.0.min.js"></script> <script> $(window).bind('hashchange', function() { //code console.log('Page has changed') startObserving() }); let observer = new MutationObserver(function (mutations, me) { $(".lazyload-wrapper").find('img.fd-image').each(function(){ $(this).attr('srcset', $(this).attr('srcset').replace(/jpg(.)+/,'jpg')); }); }) function startObserving() { console.log('Starting Observing') observer.observe(document, { childList: true, subtree: true, }) } startObserving() </script>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter