It is good to share articles with some animated GIF pictures, which can display some information and make users understand the key points of the article better;GIF image files are larger than static images. If a page displays too many GIF animated images, the browser resources will be high when the page is opened, and the page will get stuck. At this time, we can use this special effect code to control the pause of GIF animated images. When the page is opened, all GIF animations will be paused,It only starts playing after clicking, which effectively reduces the browser resource occupation. This is a good user experience compared with playing GIF animation once the page is opened. The JS file, which controls the pause of GIF animation, is less than 2KB in size and can be used by referencing it to the page in the following wayjqueryLibrary, so when installing the code, check whether the next page references the jquery library. If not, add the jquery library reference code yourself.
Add the following code before the page source code</head>, and note the reference path of gifffer.js:<script type="text/javascript" src="gifffer.js"></script><script>$(document).ready(function(){$('img[src$=gif]').each(function(){var imgdata= $(this)[0].src;$(this).removeAttr('src').attr('data-gifffer',imgdata);})});window.onload = function(){Gifffer();}</script>
All content resources shared by this website, if not noted, are original by Blueleaf. If you need to reprint, please indicate the source;Please contact us in case of infringementContact handling。Please understand!