public marks

PUBLIC MARKS from decembre with tags example & image

2018

JAVASCRIPT - IMAGE - LAZY LOAD - Lazy Loading Images? Don’t Rely On JavaScript! | Robin Osborne

(via)
One popular method to deal with this is to “Lazy Load” the images; that is, to only load the images just before the user will need to see them. If this technique is applied to the “above the fold” content – i.e., the first average viewport-sized section of the page – then the user can get a significantly faster first view experience. So everyone should always do this, right? Given the potential limitations, let’s work on a solution that can handle all my concerns: a. works without JavaScript (i.e., lazy loading is an enhancement) b. vanilla js – no dependencies on jquery or angularjs c. works with broken JavaScript (i.e., the browser supports JavaScript, but there’s a js error somewhere which causes your script to break; might not even be your fault!)

2014

javascript - Use Greasemonkey to replace links, to images, with images? - Stack Overflow

Replacing links to images is not too hard to do. However, I recommend that you keep the link but display the picture inside it. This is so you can click through if something goes wrong. For example, that sample page you gave has most of the linked images on a dead site. Other linked images only look like they point to images or might be blocked for "hot linking". To make the code robust and easy, we use jQuery and waitForKeyElements. Here is a complete working script that delinks the payload image-links on that sample site: