Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removing some repeating from the API

  • Loading branch information...
commit fd4f77192df62c69bcbb5ff0b3d215b8deeefec3 1 parent d87c826
@jakearchibald authored
Showing with 8 additions and 13 deletions.
  1. +3 −7 css/base.css
  2. +3 −5 index.html
  3. +2 −1  js/responsiveGallery.js
View
10 css/base.css
@@ -54,10 +54,6 @@ img {
opacity: 1;
}
/* Responsive stuff */
- .gallery-test,
- .video-intro-test {
- width: 1px;
- }
@media all and (min-width: 640px) {
[role="main"] {
width: 60%;
@@ -68,15 +64,15 @@ img {
float: right;
}
.video-intro-test {
- width: 2px;
+ width: 1px;
}
}
@media all and (min-width: 926px) {
.gallery-test {
- width: 2px;
+ width: 1px;
}
.video-intro-test {
- width: 3px;
+ width: 2px;
}
.gallery a:link,
.gallery a:visited {
View
8 index.html
@@ -270,8 +270,7 @@
testClass: 'gallery-test',
initialSuffix: '_s.jpg',
suffixes: {
- '1': '_s.jpg',
- '2': '_m.jpg'
+ '1': '_m.jpg'
}
});
responsiveGallery({
@@ -279,9 +278,8 @@
testClass: 'video-intro-test',
initialSuffix: '_t.jpg',
suffixes: {
- '1': '_t.jpg',
- '2': '_m.jpg',
- '3': '.jpg'
+ '1': '_m.jpg',
+ '2': '.jpg'
}
});
</script>
View
3  js/responsiveGallery.js
@@ -38,6 +38,7 @@
// Add the test div to the page
testDiv.className = args.testClass || 'gallery-test';
+ testDiv.style.cssText = 'position:absolute;top:-100em';
document.body.insertBefore( testDiv, document.body.firstChild );
// Init galleries
@@ -50,7 +51,7 @@
}
function respond() {
- var newSuffix = args.suffixes[testDiv.offsetWidth];
+ var newSuffix = args.suffixes[testDiv.offsetWidth] || args.initialSuffix;
if (newSuffix === lastSuffix) {
return;
Please sign in to comment.
Something went wrong with that request. Please try again.