Get started with lory.js CDN
MIT licensed
Lory.js is a lightweight library for responsive image loading and optimization.
Tags:- responsive
- lightweight
- minimalistic
- carousel
- slider
- touch
- slideshow
- jQuery
- mobile
Stable version
Copied!
How to start using lory.js CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with lory.js CDN - cdnhub.io</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lory/2.5.3/css/lory.min.css">
<script src="https://cdn.cdnhub.io/lory.js/2.5.3/lory.min.js"></script>
</head>
<body>
<div id="lory-container">
<button id="load-more">Load More</button>
<ul id="lory-list"></ul>
</div>
<script>
const container = document.getElementById('lory-container');
const loadMoreButton = document.getElementById('load-more');
const loryList = document.getElementById('lory-list');
const lory = new Lory({
container,
element: 'ul',
size: 'small',
columns: 3,
gap: 15,
threshold: 0,
callback: () => {
if (lory.hasMore) {
loadMoreButton.disabled = false;
}
},
loadMore: () => {
// Add new items to the list here
// For example, using an AJAX call or fetching data from an API
const newItems = fetchNewItems();
loryList.append(...newItems);
},
});
loadMoreButton.addEventListener('click', () => {
lory.loadMore();
});
</script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
0.0.0
0.1.0
0.2.0
0.2.1
0.2.2
0.2.3
0.2.4
0.3.0
0.3.1
0.4.0
0.4.1
0.4.2
0.4.3
0.4.4
0.4.5
0.4.6
0.5.0
0.6.0
0.6.1
0.6.2
0.7.0
1.0.0
1.1.0
1.1.1
1.2.0
1.2.1
1.2.2
1.2.3
1.2.4
1.2.5
1.2.6
1.3.0
1.4.0
1.4.1
1.4.2
1.4.3
1.5.0
1.5.1
1.5.2
1.6.0
1.6.1
1.6.2
1.6.3
1.6.4
1.6.5
1.6.6
1.6.7
1.6.8
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
2.1.4
2.1.5
2.1.6
2.1.7
2.2.0
2.2.1
2.3.0
2.3.1
2.3.2
2.3.3
2.3.4
2.3.5
2.4.0
2.4.1
2.4.2
2.4.3
2.4.4
2.5.0
2.5.1
2.5.2
*** 2.5.3