Comments (3)
I can't see the link, I got a 403 error in the console. I have a non-premium account on CodePen, not sure if it's related
from haruneko.
I don't have any account, it's open to everyone.
here is the codepen:
<div class="container">
<img src="http://cumbrianrun.co.uk/wp-content/uploads/2014/02/default-placeholder-300x300.png" alt="" data-src="https://instagram.ftpe8-4.fna.fbcdn.net/vp/858878e86ee732def268b2b33fadb5bc/5B7554EE/t51.2885-15/e35/30078878_134250340653099_1383951987346767872_n.jpg" />
<img src="http://cumbrianrun.co.uk/wp-content/uploads/2014/02/default-placeholder-300x300.png" alt="" data-src="https://instagram.ftpe8-4.fna.fbcdn.net/vp/858878e86ee732def268b2b33fadb5bc/5B7554EE/t51.2885-15/e35/30078878_134250340653099_1383951987346767872_n.jpg" />
<img src="http://cumbrianrun.co.uk/wp-content/uploads/2014/02/default-placeholder-300x300.png" alt="" data-src="https://instagram.ftpe8-4.fna.fbcdn.net/vp/858878e86ee732def268b2b33fadb5bc/5B7554EE/t51.2885-15/e35/30078878_134250340653099_1383951987346767872_n.jpg" />
<img src="http://cumbrianrun.co.uk/wp-content/uploads/2014/02/default-placeholder-300x300.png" alt="" data-src="https://instagram.ftpe8-4.fna.fbcdn.net/vp/858878e86ee732def268b2b33fadb5bc/5B7554EE/t51.2885-15/e35/30078878_134250340653099_1383951987346767872_n.jpg" />
<img src="http://cumbrianrun.co.uk/wp-content/uploads/2014/02/default-placeholder-300x300.png" alt="" data-src="https://instagram.ftpe8-4.fna.fbcdn.net/vp/858878e86ee732def268b2b33fadb5bc/5B7554EE/t51.2885-15/e35/30078878_134250340653099_1383951987346767872_n.jpg" />
<img src="http://cumbrianrun.co.uk/wp-content/uploads/2014/02/default-placeholder-300x300.png" alt="" data-src="https://instagram.ftpe8-4.fna.fbcdn.net/vp/858878e86ee732def268b2b33fadb5bc/5B7554EE/t51.2885-15/e35/30078878_134250340653099_1383951987346767872_n.jpg" />
<img src="http://cumbrianrun.co.uk/wp-content/uploads/2014/02/default-placeholder-300x300.png" alt="" data-src="https://instagram.ftpe8-4.fna.fbcdn.net/vp/858878e86ee732def268b2b33fadb5bc/5B7554EE/t51.2885-15/e35/30078878_134250340653099_1383951987346767872_n.jpg" />
</div>
body {
padding: 0;
padding-bottom: 30px;
margin: 0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.container {
width: 50%;
margin: 0 auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
img {
margin-top: 30px;
display: block;
height: 500px;
}
(function() {
function throttle(fn, time) {
let start = new Date();
return function() {
let context = this;
let args = arguments;
let current = new Date();
// reach to a time, trigger the function
if (current - start >= time) {
fn.apply(context, args);
start = current;
}
}
}
function lazyLoad() {
const loadingImage = 'http://cumbrianrun.co.uk/wp-content/uploads/2014/02/default-placeholder-300x300.png';
const images = document.getElementsByTagName('img');
let count = 0;
return function() {
const clientHeight = document.documentElement.clientHeight;
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
for (let i = count; i < images.length; i++) {
if (images[i].offsetTop < clientHeight + scrollTop) {
if (images[i].getAttribute('src') === loadingImage) {
images[i].src = images[i].getAttribute('data-src');
}
count = count + 1;
}
}
}
}
const loadImages = lazyLoad();
// load first image
loadImages();
window.addEventListener('scroll', throttle(loadImages, 1000), false);
})();
from haruneko.
Provided with commit 7ac892d
from haruneko.
Related Issues (20)
- Add file OremangaNet.mjs but not woking HOT 1
- Stuck in chapter fetching until timeout (recaptcha)
- (Feature Request) Context menu options in items pane HOT 2
- No Indicator chapters status in items pane HOT 1
- Mouse pointer is flickering HOT 1
- Better PDF/CBR/CBZ/EPUB generation ? HOT 5
- Image spacing in Viewer HOT 2
- Chapter file format HOT 2
- [NWjs] Window drag no longer working HOT 4
- Problem connecting to sites HOT 6
- Novels: how to handle them ?
- add download chapter as pdf HOT 1
- application is not opening on linux mint HOT 8
- Migration of mangas HOT 2
- There is an error when opening the website HOT 1
- (Site request) comicfans HOT 1
- Manual updating of source URL HOT 7
- Error with QUIC protocol?
- Downloaded chapters still show download icon HOT 3
- NW & Electron Limitations HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haruneko.