forked from shprink/BttrLazyLoading
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
676 additions
and
632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
body{ | ||
margin-top: 58px; | ||
} | ||
#back-to-top{ | ||
font-size: 30px; | ||
position: fixed; | ||
bottom: 20px; | ||
right: 20px; | ||
cursor: pointer; | ||
} | ||
.alert { | ||
font-size: 15px; | ||
font-weight: 500; | ||
} | ||
#loading-area > div{ | ||
margin-bottom: 15px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
<?php | ||
define('DEMO', 'different-sizes'); | ||
?> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title></title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<link rel="stylesheet" type="text/css" href="../bower_components/bootswatch/yeti/bootstrap.min.css" /> | ||
<link rel="stylesheet" type="text/css" href="../bower_components/font-awesome/css/font-awesome.min.css" /> | ||
<link rel="stylesheet" type="text/css" href="../bttrlazyloading.min.css" /> | ||
<link rel="stylesheet" type="text/css" href="css/style.css" /> | ||
<script src="../bower_components/jquery/jquery.min.js"></script> | ||
<script src="../bower_components/jquery.smooth-scroll/jquery.smooth-scroll.min.js"></script> | ||
<script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script> | ||
<link rel="stylesheet" type="text/css" href="../bower_components/highlight.js/src/styles/solarized_dark.css" /> | ||
<script src="js/highlight.pack.js"></script> | ||
<script src="../jquery.bttrlazyloading.min.js"></script> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="jumbotron"> | ||
<h1>Different sizes</h1> | ||
<p>BttrLazyLoading works even better when image sizes are defined. See for yourself!</p> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<h2>HTML</h2> | ||
<pre><code class="html"><img id="yourImg" class="bttrlazyloading" | ||
data-bttrlazyloading-xs-src="img/800x300.jpg" | ||
data-bttrlazyloading-xs-width="800" | ||
data-bttrlazyloading-xs-height="300" | ||
data-bttrlazyloading-sm-src="img/380x380.jpg" | ||
data-bttrlazyloading-sm-width="380" | ||
data-bttrlazyloading-sm-height="380" | ||
data-bttrlazyloading-md-src="img/350x350.jpg" | ||
data-bttrlazyloading-md-width="350" | ||
data-bttrlazyloading-md-height="350" | ||
data-bttrlazyloading-lg-src="img/300x300.jpg" | ||
data-bttrlazyloading-lg-width="300" | ||
data-bttrlazyloading-lg-height="300" | ||
/></pre></code> | ||
</div> | ||
<div class="col-md-6"> | ||
<h2>JavaScript</h2> | ||
<pre><code class="javascript">$('#yourImg').bttrlazyloading();</pre></code> | ||
</div> | ||
</div> | ||
<div class="alert alert-info text-center"><b>OR</b></div> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<h2>HTML</h2> | ||
<pre><code class="html"><img id="yourImg" class="bttrlazyloading" /></pre></code> | ||
</div> | ||
<div class="col-md-6"> | ||
<h2>JavaScript</h2> | ||
<pre><code class="javascript">$('#yourImg').bttrlazyloading({ | ||
xs: { | ||
src: 'http://placekitten.com/800/300', | ||
width: 800, | ||
height: 300 | ||
}, | ||
sm: { | ||
src: 'http://placekitten.com/380/380', | ||
width: 380, | ||
height: 380 | ||
}, | ||
md: { | ||
src: 'http://placekitten.com/350/350', | ||
width: 350, | ||
height: 350 | ||
}, | ||
lg: { | ||
src: 'http://placekitten.com/300/300', | ||
width: 300, | ||
height: 300 | ||
} | ||
});</pre></code> | ||
</div> | ||
</div> | ||
|
||
<div class="page-header"> | ||
<h2>Demo</h2> | ||
</div> | ||
<div class="row" id="loading-area"></div> | ||
<div class="page-header"> | ||
<h2>Mode Demos</h2> | ||
</div> | ||
<?php include 'more-demo.php'; ?> | ||
</div> | ||
<?php include '../menu.php'; ?> | ||
<script type="text/javascript"> | ||
$(function($, hljs) { | ||
$('#back-to-top').click(function(event) { | ||
$.smoothScroll({ | ||
scrollTarget: 'body' | ||
}); | ||
}); | ||
hljs.initHighlightingOnLoad(); | ||
|
||
/* DEMO */ | ||
$('.bttrlazyloading').bttrlazyloading() | ||
for (var i = 0; i < 32; i++) | ||
{ | ||
var $wrapper = $('<div class=" col-sm-6 col-md-4 col-lg-3">'); | ||
var $img = $('<img class="bttrlazyloading">'); | ||
$wrapper.append($img); | ||
$('#loading-area').append($wrapper); | ||
$img.bttrlazyloading({ | ||
delay: 1000, | ||
xs: { | ||
src: 'img/800x300.jpg', | ||
width: 800, | ||
height: 300 | ||
}, | ||
sm: { | ||
src: 'img/380x380.jpg', | ||
width: 380, | ||
height: 380 | ||
}, | ||
md: { | ||
src: 'img/350x350.jpg', | ||
width: 350, | ||
height: 350 | ||
}, | ||
lg: { | ||
src: 'img/300x300.jpg', | ||
width: 300, | ||
height: 300 | ||
} | ||
}); | ||
} | ||
}(jQuery, hljs)); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.