Logo Slider
How do I make an logo slider?
A simple plugin for sliding company logos. The slider has two options, transition speed and snapping.. What is a logo slider? How do you make a logo slider? This script and codes were developed by John Urbank on 08 July 2022, Friday.
Logo Slider - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Logo Slider</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <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 { box-sizing: border-box;
}
body { background: #d9d8c6;
}
li { list-style: none;
}
.suga-container { background: #5b5a5c; padding: .2em; max-width: 570px; margin: 5em auto; box-shadow: 3px 3px 0px #353435; border: 2px solid #353435; border-radius: 5px;
}
.suga-slider-wrap { overflow: hidden; margin: 1em;
}
.suga-slider-group:before, .suga-slider-group:after { content: " "; display: table;
}
.suga-slider-group:after { clear: both;
}
.suga-slide { float: left; position: relative; margin-left: 0; padding-right: 8px;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div id="logos"> <ul> <li><img src="http://placehold.it/100x100" /></li> <li><img src="http://placehold.it/100x100" /></li> <li><img src="http://placehold.it/100x100" /></li> <li><img src="http://placehold.it/100x100" /></li> <li><img src="http://placehold.it/100x100" /></li> <li><img src="http://placehold.it/100x100" /></li> </ul>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Logo Slider - Script Codes CSS Codes
*, *:before, *:after { box-sizing: border-box;
}
body { background: #d9d8c6;
}
li { list-style: none;
}
.suga-container { background: #5b5a5c; padding: .2em; max-width: 570px; margin: 5em auto; box-shadow: 3px 3px 0px #353435; border: 2px solid #353435; border-radius: 5px;
}
.suga-slider-wrap { overflow: hidden; margin: 1em;
}
.suga-slider-group:before, .suga-slider-group:after { content: " "; display: table;
}
.suga-slider-group:after { clear: both;
}
.suga-slide { float: left; position: relative; margin-left: 0; padding-right: 8px;
}
Logo Slider - Script Codes JS Codes
/*
Suga Slider
Usage ---------
$(window).load(function(){ $('#logos').suga({ 'transitionSpeed': 2000, 'snap': false });
});
The markup should resemble the markup here
*/
$.fn.suga = function(options) { var settings = $.extend({ 'transitionSpeed': 3000, 'snap': false }, options); var $this = $(this); // add plugin specific classes $this.addClass('suga-slider-wrap'); $this.children('ul').addClass('suga-slider-group'); $this.find('li').addClass('suga-slide'); // caching $$$ var $slide = $('.suga-slide'), $firstEl = $('.suga-slide:first'), $group = $('.suga-slider-group'), $wrap = $('.suga-slider-wrap'); var slideWidth = $slide.outerWidth(), slideHeight = $('.suga-slide').height(), slideCount = $slide.length, totalWidth = slideWidth * slideCount; // set width on group element $group.width(totalWidth); $wrap.height(slideHeight); $wrap.wrap('<div class="suga-container"></div>'); // add first class at start if (!$group.find($firstEl).hasClass("suga-first")) { $group.find($firstEl).addClass("suga-first"); } // lets move baby var transitionSnap = function() { var $firstEl = $group.find('.suga-first').html(); $group.find('.suga-first').animate({ 'margin-left': '-' + slideWidth + 'px' }, function(){ $group.append('<li class="suga-slide">' + $firstEl + '</li>'); $(this).remove(); $group.find('li:first').addClass("suga-first"); }); }; var transitionScroll = function() { var $firstEl = $group.find('.suga-first').html(); $group.find('.suga-first').animate({ 'margin-left': '-' + slideWidth + 'px' }, settings.transitionSpeed, 'linear', function(){ $group.append('<li class="suga-slide">' + $firstEl + '</li>'); $(this).remove(); $group.find('li:first').addClass("suga-first"); transitionScroll(); }); }; if (settings.snap) { window.setInterval(transitionSnap, settings.transitionSpeed); } else { transitionScroll(); }
}
$(window).load(function(){ $('#logos').suga({ 'transitionSpeed': 2000, 'snap': true });
});
Developer | John Urbank |
Username | jurbank |
Uploaded | July 08, 2022 |
Rating | 3 |
Size | 3,508 Kb |
Views | 206,448 |
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 |
Tape Cassette Icon - CSS Only | 6,789 Kb |
Navicon - responsive nav pattern | 3,469 Kb |
Gutterless Feature Grid | 3,013 Kb |
Basic motion with JavaScript | 2,202 Kb |
Traveling through Tron - Best viewed in Webkit | 3,195 Kb |
Diagonal CSS Pattern | 1,790 Kb |
String permutation | 2,875 Kb |
CubeTronic | 3,716 Kb |
A Pen by John Urbank | 2,984 Kb |
Simple jQuery Slider | 2,874 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 |
Starting out with Ember.JS | Cfleschhut | 4,808 Kb |
Rotate Demo | Agelber | 3,061 Kb |
Webkit decolorize | Fivera | 1,675 Kb |
Elon Musk - Tribute Page - FreeCodeCamp | Yunnimun | 8,615 Kb |
Mandelbrot Fractal | _Billy_Brown | 2,706 Kb |
Improve | Gavra | 1,652 Kb |
CSS Donut Charts | Seanstopnik | 2,908 Kb |
Beveled corners using CSS border attribute | DawsonMediaD | 2,136 Kb |
A Pen by Jay | Jaycode | 3,784 Kb |
Pure CSS Dial | Lukewatts | 3,018 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!