Drive-ThruJS/Drive-Thru.js (Carousel Lazy-loader)
How do I make an drive-thrujs/drive-thru.js (carousel lazy-loader)?
Copyright 2014 by Intellectual Reserve, Inc.Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0. What is a drive-thrujs/drive-thru.js (carousel lazy-loader)? How do you make a drive-thrujs/drive-thru.js (carousel lazy-loader)? This script and codes were developed by Adam on 07 January 2023, Saturday.
Drive-ThruJS/Drive-Thru.js (Carousel Lazy-loader) - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Drive-ThruJS/Drive-Thru.js (Carousel Lazy-loader)</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ *, *:before, *:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
html {
background: #7d7e7d;
background: -moz-linear-gradient(top, #7d7e7d 0%, #0e0e0e 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#7d7e7d), color-stop(100%,#0e0e0e));
background: -webkit-linear-gradient(top, #7d7e7d 0%,#0e0e0e 100%);
background: -o-linear-gradient(top, #7d7e7d 0%,#0e0e0e 100%);
background: -ms-linear-gradient(top, #7d7e7d 0%,#0e0e0e 100%);
background: linear-gradient(to bottom, #7d7e7d 0%,#0e0e0e 100%);
}
body { width: 960px; margin: 0 auto; font-family: 'Georgia', sans-serif;
}
ol li { margin-bottom: 10px;
}
ol li ul li { font-size: 0.75rem;
}
textarea { display: block; width: 100%; overflow: hidden; margin: 5px 0; padding: 15px; border-radius: 15px; background: #ff5500; color: #fff; font-family: 'Courier', sans-serif;
}
textarea.required-load-method { height: 50px;
}
textarea.required-attributes { height: 65px;
}
textarea.optional { height: 80px; background: #bb5500;
}
.slideshow { position: relative; width: 820px; margin-top: 1em; overflow: scroll;
}
.sliderNav { display: none;
}
.sliderNav a { position: absolute; text-decoration: none; color: #fff; font-size: 5em; opacity: 0.25;
}
.sliderNav a:hover { opacity: 0.5;
}
.sliderNav a:first-child { top: 220px; left: 15px;
}
.sliderNav a:last-child { top: 220px; right: 15px;
}
.slideshow ul { list-style-type: none; padding: 0; width: 5000px;
}
.slideshow li { float: left;
}
.slideshow img { width: 820px; border: 10px solid #222;
}
a { color: #000; text-shadow: 0 0 5px #000;
}
div { position: absolute; top: 25px; right: 25px; font-size: 0.8rem;
}
.logo { position: absolute; top: 25px; left: 25px;
}
.github-wrapper { position: absolute; z-index: 100; top: 0; right: 0; width: 100%; height: 250px; overflow: hidden;
}
.github { position: absolute; top: 50px; right: -60px; display: block; width: 250px; padding: 10px; border: 1px dashed #ccc; text-decoration: none; background: #ff0; box-shadow: 0 0 0 4px #ff0; color: #fff; text-shadow: 0 0 4px #000; vertical-align: middle; text-align: center; transform: rotate(45deg);
}
.github:hover:before { content: attr(href); position: absolute; top: 200px; right: 200px; text-align: right; transform: rotate(-45deg);
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <h1>DRIVE-THRUJS Lite / DRIVE-THRU.JS Lite (Plugin)</h1>
<h2>Super-Simple-Image-Carousel-Lazy-Loader</h2>
<p>All you need is 4 things:</p>
<ol> <li>jQuery</li> <li>The "Drive-Thru" script</li> <li>Place this in your carousel script where you can pass in the current slide number each time it changes: <textarea class="required-load-method">DRIVE_THRU.load(num);</textarea> </li> <li>Then make each <img> element look like this: <textarea class="required-attributes"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-drive-thru="http://your-actual-image-url.jpg" alt="alternate text here"/></textarea> <ul> <li><strong>Optional</strong> fallback (don't worry, it doesn't get loaded but makes images available to users without JavaScript): <textarea class="optional"> <noscript> <img src="http://your-actual-image-url.jpg" alt="alternate text here"/> </noscript></textarea> </li> </ul> </li> </ol> <h3>EXAMPLE:</h3> <figure class="slideshow"> <nav class="sliderNav"> <a href="#d" data-direction="left">◀</a> <a href="#d" data-direction="right">▶</a> </nav> <ul> <li> <noscript> <img src="http://photography.clearwavedesigns.com/gallery/images/gallery/architectures/architectures%20(1).jpg" alt="image"/> </noscript> <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-drive-thru="http://photography.clearwavedesigns.com/gallery/images/gallery/architectures/architectures%20(1).jpg" alt="image" /> </li> <li> <noscript> <img src="http://photography.clearwavedesigns.com/gallery/images/gallery/architectures/architectures%20(3).jpg" alt="image"/> </noscript> <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-drive-thru="http://photography.clearwavedesigns.com/gallery/images/gallery/architectures/architectures%20(3).jpg" alt="image" /> </li> <li> <noscript> <img src="http://photography.clearwavedesigns.com/gallery/images/gallery/architectures/architectures%20(4).jpg" alt="image"/> </noscript> <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-drive-thru="http://photography.clearwavedesigns.com/gallery/images/gallery/architectures/architectures%20(4).jpg" alt="image" /> </li> <li> <noscript> <img src="http://photography.clearwavedesigns.com/gallery/images/gallery/architectures/architectures%20(5).jpg" alt="image"/> </noscript> <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-drive-thru="http://photography.clearwavedesigns.com/gallery/images/gallery/architectures/architectures%20(5).jpg" alt="image" /> </li> <li> <noscript> <img src="http://photography.clearwavedesigns.com/gallery/images/gallery/architectures/architectures%20(6).jpg" alt="image"/> </noscript> <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-drive-thru="http://photography.clearwavedesigns.com/gallery/images/gallery/architectures/architectures%20(6).jpg" alt="image" /> </li> <li> <noscript> <img src="http://photography.clearwavedesigns.com/gallery/images/gallery/architectures/architectures%20(7).jpg" alt="image"/> </noscript> <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-drive-thru="http://photography.clearwavedesigns.com/gallery/images/gallery/architectures/architectures%20(7).jpg" alt="image" /> </li> </ul> </figure> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABuCAYAAADGWyb7AAAVuUlEQVR4Ae2deZAURb7Hf3MxwwznyCWCgCKMCAj4FjlWDoEFAg3x4VvwD85QRJenGLFvQXFXQVE8QV8oAn94vEBg9bnoHwKyBgPKISuiC7geMIKiHCLHKDDMcGx9csgmO6e6e3q6iqke+hdRXVdWVubvW78zs6rlmmuu+UZEzqaW5OEBmKUB2MKFC51VipKFA3feeadk0tizZxG4FCUTB9KTqbGptp7nQAq487xIqq0UcEkF1/nGpmzceV4k1ZYCrjpbvH79ejl69KiUlpZKfn5+qCk//PCDtG/fXo4dOyaHDx+WSy65RBo1aiS1a9eWli1bhspdrBvVDhyMb9CggbRu3ToMgz179kizZs3kq6++krZt2ypg33rrLWnTpo18+eWX0r17d0lLS5O6detKWVmZAviKK66QrKwsdV29evXC6qtpO4EArm/fvjJu3LgKvP3Ln+6TY2vmho4//fspknlZFwXi5n0i//q6SA4dOiQ//fSTZGZmyq+//qqk9tSpU7J37151HGk+ceKEnDx5MiS1LVq0kNzc3FC9ybgRCODcGAfzz5w4IsdWznA7LQXO0Q71mklmkwLJaNNaMltdLyW5LWTroVpyuPi4fP7559KwYUMVoyKxTZs2lf3798u1116rJBaJZv/gwYMKdKS7fv360q5dO9f7Be2gAq46A3BUmxsdP35c0ms3cDsVOnameJ+UOouiTa+qFYCmO4D2BdD81pLesJVktb5e9h85IUUlBbJmzRo5cuSIktr09HTp0aOHAoyLkU4kFSlm+f777xX4qGBsLEtQqNolLpItKikpkTQHOMBD8uKhMEDPXZjtrK92lo4OmBltnUWB2kYym7aXA8dEik41k3379imbSpsAFWcoJydHNm7cqMBm/7vvvpNL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pOb7WD2678BDcfoMtHL/REAAAAASUVORK5CYII=" alt="logo" class="logo"/> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Drive-ThruJS/Drive-Thru.js (Carousel Lazy-loader) - Script Codes CSS Codes
*, *:before, *:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
html {
background: #7d7e7d;
background: -moz-linear-gradient(top, #7d7e7d 0%, #0e0e0e 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#7d7e7d), color-stop(100%,#0e0e0e));
background: -webkit-linear-gradient(top, #7d7e7d 0%,#0e0e0e 100%);
background: -o-linear-gradient(top, #7d7e7d 0%,#0e0e0e 100%);
background: -ms-linear-gradient(top, #7d7e7d 0%,#0e0e0e 100%);
background: linear-gradient(to bottom, #7d7e7d 0%,#0e0e0e 100%);
}
body { width: 960px; margin: 0 auto; font-family: 'Georgia', sans-serif;
}
ol li { margin-bottom: 10px;
}
ol li ul li { font-size: 0.75rem;
}
textarea { display: block; width: 100%; overflow: hidden; margin: 5px 0; padding: 15px; border-radius: 15px; background: #ff5500; color: #fff; font-family: 'Courier', sans-serif;
}
textarea.required-load-method { height: 50px;
}
textarea.required-attributes { height: 65px;
}
textarea.optional { height: 80px; background: #bb5500;
}
.slideshow { position: relative; width: 820px; margin-top: 1em; overflow: scroll;
}
.sliderNav { display: none;
}
.sliderNav a { position: absolute; text-decoration: none; color: #fff; font-size: 5em; opacity: 0.25;
}
.sliderNav a:hover { opacity: 0.5;
}
.sliderNav a:first-child { top: 220px; left: 15px;
}
.sliderNav a:last-child { top: 220px; right: 15px;
}
.slideshow ul { list-style-type: none; padding: 0; width: 5000px;
}
.slideshow li { float: left;
}
.slideshow img { width: 820px; border: 10px solid #222;
}
a { color: #000; text-shadow: 0 0 5px #000;
}
div { position: absolute; top: 25px; right: 25px; font-size: 0.8rem;
}
.logo { position: absolute; top: 25px; left: 25px;
}
.github-wrapper { position: absolute; z-index: 100; top: 0; right: 0; width: 100%; height: 250px; overflow: hidden;
}
.github { position: absolute; top: 50px; right: -60px; display: block; width: 250px; padding: 10px; border: 1px dashed #ccc; text-decoration: none; background: #ff0; box-shadow: 0 0 0 4px #ff0; color: #fff; text-shadow: 0 0 4px #000; vertical-align: middle; text-align: center; transform: rotate(45deg);
}
.github:hover:before { content: attr(href); position: absolute; top: 200px; right: 200px; text-align: right; transform: rotate(-45deg);
}
Drive-ThruJS/Drive-Thru.js (Carousel Lazy-loader) - Script Codes JS Codes
/* * Copyright 2014 by Intellectual Reserve, Inc. * * Licensed under the Apache License, Version 2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Author: Adam Carson * Website: http://clearwavedesigns.com/code/plugins/ * Dependencies: jquery.js (1.8.3+) * * Name: DRIVE-THRUJS Lite / DRIVE-THRU.JS Lite * Description: Very simple carousel image lazy-loader. * Options: Change the current percent and the time it takes to complete */
// Drive-Thru is a super simple image carousel lazy loader. Why call it "Drive-Thru?" Well, I'm tired--so that's the 1st reason. The 2nd, is because the server at the drive-thru window watches for when you pull up and then serves you the food you wanted. Likewise, lazy-loading watches for the next needed image and loads that before it slides/fades into view!
// DRIVE_THRU WINDOW OBJECT
var DRIVE_THRU = { // Get all of the images with a data attribute of "drive-thru". images : $('[data-drive-thru]'), // This is the image loader. load : function(num) { // Get the last image index. var last = this.images.length - 1; // Declare an empty variable (will be an array later). var load_images; // If first slide, i.e. index "0", then store that first in the array, then the next one and the preceding one depending on which direction the user or animation moves to next. if (num === 0) { load_images = [0,1,last]; } // If last slide, then store this in the array, the next one (the first one), and the preceding one. else if (num === last) { load_images = [last, 0, last - 1]; } // If not the first or last slide, store it in the array, the next one and the preceding one. else { load_images = [num, num + 1, num - 1]; } // Load the actual images as indicated by the new array for(var i = 0, length = load_images.length; i < length; i++) { var data_src = this.images.eq(load_images[i]).data('drive-thru'), src = this.images.eq(load_images[i]).attr('src'); // Don't reload images that have already been loaded, so if the data-drive-thru and src are the same, skip loading and move on to the next; otherwise load the data-drive-thru value into the actual src...and wah-bam!, lazy loading! if (data_src !== src) { this.images.eq(load_images[i]).attr('src', data_src); } } }, init : function() { this.load(0); // Opening slide }
}; // End DRIVE_THRU object
DRIVE_THRU.init();
// 1x1px data gif from: https://css-tricks.com/snippets/html/base64-encode-of-1x1px-transparent-gif/
// WHITE: <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"/>
// BLACK: <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="/>
// This simple slider part was learned from: "Prototypal Inheritance and Refactoring the Slider" (https://tutsplus.com/lesson/prototypal-inheritance-and-refactoring-the-slider)
function SimpleSlider( container, nav ) { this.container = container; this.nav = nav; this.allImages = this.container.find('img'); this.imagesWidth = this.allImages[0].width + parseInt(this.allImages.css('border-left-width')) * 2; this.imagesLength = this.allImages.length; this.currentLocale = 0;
}
SimpleSlider.prototype.setLocation = function( direction ) { var position = this.currentLocale; position += ( ~~( direction === 'right') || - 1); this.currentLocale = ( position < 0) ? this.imagesLength - 1 : position % this.imagesLength; return position;
};
SimpleSlider.prototype.transition = function( location ) { DRIVE_THRU.load(this.currentLocale); // This sends the slides current position to the load function in the DRIVE_THRU plugin. this.container.animate({ 'margin-left': location || -( this.currentLocale * this.imagesWidth ) });
};
(function() { $('.slideshow').css('overflow', 'hidden'); $('.sliderNav').show(); var ss = new SimpleSlider( $('.slideshow ul'), $('.sliderNav') ); ss.nav.find('a').on('click', function(e) { e.preventDefault(); ss.setLocation( $(this).data('direction') ); ss.transition(); });
})();
Developer | Adam |
Username | depthdev |
Uploaded | January 07, 2023 |
Rating | 3 |
Size | 12,009 Kb |
Views | 6,072 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
CSS Book with Scrolling Highlighter | 0 Kb |
Pure JavaScript Draggable Ball | 2,599 Kb |
Canvas Arc | 2,389 Kb |
Responsive SVG Line Graph with Animation | 3,954 Kb |
Pure CSS Bulging Box | 2,224 Kb |
Responsive. Interactive. SVG. | 20,357 Kb |
YouTube URL Parser | 3,519 Kb |
Pure CSS Animated Photo Stack | 2,486 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Starfield old school style | Bolloxim | 5,214 Kb |
A Pen by Stan Williams | Stanssongs | 6,706 Kb |
Ionic Infinite outside ion-content with ion-pane | Felquis | 3,117 Kb |
Growing Root - Scroll control - CANVAS | Cjonasw | 2,342 Kb |
Prototype Responsive Homepage | Heyitsolivia | 7,677 Kb |
Impress JS Algorhytmic Generator | Jeffscottward | 7,906 Kb |
Tic Tac Toe | Volv | 4,862 Kb |
Mario | Takaneichinose | 3,902 Kb |
Sticky Navbar | Phantomesse | 5,106 Kb |
SVG Circle Progress | JMChristensen | 3,368 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!