Skip to content

Commit

Permalink
Lazyload demo fix.
Browse files Browse the repository at this point in the history
Starting at 320 and increasing the size of the window reveals that lazyloaded images do not scale up if necessary.

refs #71
  • Loading branch information
oncletom committed Oct 25, 2014
1 parent 98550f5 commit 79c7a35
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Imager.js [![Build Status](https://secure.travis-ci.org/BBC-News/Imager.js.png?branch=master)](http://travis-ci.org/BBC-News/Imager.js)
# Imager.js [![Build Status](https://secure.travis-ci.org/BBC-News/Imager.js.svg?branch=master)](http://travis-ci.org/BBC-News/Imager.js)

> Imager.js is an alternative solution to the issue of how to handle responsive image loading, created by developers at [BBC News](http://responsivenews.co.uk/).
Expand Down
28 changes: 15 additions & 13 deletions demos/lazyload/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,25 @@ <h1>Imager.js</h1>
<p>We've also set the scrollDelay (i.e. the delay between scrolling and replacing a placeholder with an image) to be very high (two seconds). This is so you can visually see the lazy-loading of images as they happen.</p>
<p>The default value is 250ms but you can override that to your own preference.</p>

<div class="delayed-image-load" data-src="Assets/Images/Generated/A-{width}.jpg" data-width="640"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/B-{width}.jpg" data-width="640"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/C-{width}.jpg" data-width="640"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/D-{width}.jpg" data-width="640"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/E-{width}.jpg" data-width="640"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/F-{width}.jpg" data-width="640"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/G-{width}.jpg" data-width="640"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/H-{width}.jpg" data-width="640"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/I-{width}.jpg" data-width="640"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/A-{width}.jpg"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/B-{width}.jpg"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/C-{width}.jpg"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/D-{width}.jpg"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/E-{width}.jpg"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/F-{width}.jpg"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/G-{width}.jpg"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/H-{width}.jpg"></div>
<div class="delayed-image-load" data-src="Assets/Images/Generated/I-{width}.jpg"></div>

<script src="../../Imager.js"></script>
<script>
new Imager({
lazyload: true,
scrollDelay: 2000, // We'll set this quite high so we get a chance to see the lazy loading happening
availableWidths: [320, 640, 1024]
function startImager(){
return new Imager({
lazyload: true,
scrollDelay: 2000, // We'll set this quite high so we get a chance to see the lazy loading happening
availableWidths: [320, 640, 1024]
});
}
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"test": "npm run test-pre && ./node_modules/karma/bin/karma start",
"test-pre": "jshint Imager.js",
"test-watch": "./node_modules/karma/bin/karma start --auto-watch",
"test-watch": "./node_modules/karma/bin/karma start --auto-watch --no-single-run",
"build": "uglifyjs ./Imager.js -c -m -o ./Imager.min.js --source-map ./Imager.map.js && mv -f Imager.{map,min}.js ./dist",
"release": "for TASK in (test-pre test-local build changelog changelog-post tag-and-publish); do npm run $TASK; done",
"changelog": "github-changes -o BBC-News -r Imager.js -n ${npm_package_version} -a --use-commit-body --only-merges",
Expand Down

0 comments on commit 79c7a35

Please sign in to comment.