Slider
How do I make an slider?
What is a slider? How do you make a slider? This script and codes were developed by Adam Lowenthal on 12 October 2022, Wednesday.
Slider - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Slider</title> <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/8.0.2/nouislider.min.css'>
<link rel='stylesheet prefetch' href='css/zggxyg.css'>
<link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"> <!-- "Within 'x' miles of location" --> <div class="slider"> <div class="slider__label"> <span class="slider--distance__label"> This is a distance of <span class="slider--label__value" id="slider--distance__value">7487.80</span> from the capital. </span> <span class="slider--distance__variable"> All distances </span> </div> <div id="slider--distance"></div> </div> <!-- / --> <!-- "Profile updated within 'x' days" --> <div class="slider"> <div class="slider__label"> <span class="slider--updatedWithin__label"> This is a distance of <span class="slider--label__value" id="slider--updatedWithin__value">7487.80</span> from the capital. </span> <span class="slider--updatedWithin__variable"> All Profiles </span> </div> <div id="slider--updatedWithin"></div> </div> <!-- / -->
</div>
<!-- /container --> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/8.0.2/nouislider.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Slider - Script Codes CSS Codes
.container{ width: 60em; margin: 60px auto 0 auto;
}
.slider{ margin: 60px 0;
}
.slider--label__value{ color: red;
}
Slider - Script Codes JS Codes
/* ===== Distance Slider ===== */
var sliderMin = 0;
var sliderMax = 50;
var sliderMid = sliderMax / 2;
var rangeSlider = document.getElementById('slider--distance');
noUiSlider.create(rangeSlider, { start: sliderMid, range: { 'min': sliderMin, 'max': sliderMax }
});
//Value
var rangeSliderValueElement = document.getElementById('slider--distance__value');
rangeSlider.noUiSlider.on('update', function(values, handle) { if(values[handle] < sliderMax){ rangeSliderValueElement.innerHTML = values[handle]; $('.slider--distance__variable').hide(); $('.slider--label').show(); } else{ $('.slider--label').hide(); $('.slider--distance__variable').show(); }
});
/* ===== / Distance Slider ===== */
/* ===== Profile Updated Within Slider ===== */
var sliderMin = 0;
var sliderMax = 180;
var sliderMid = sliderMax / 2;
var rangeSlider = document.getElementById('slider--updatedWithin');
noUiSlider.create(rangeSlider, { start: sliderMid, range: { 'min': sliderMin, 'max': sliderMax }
});
//Value
var rangeSliderValueElement = document.getElementById('slider--updatedWithin__value');
rangeSlider.noUiSlider.on('update', function(values, handle) { if(values[handle] < sliderMax){ rangeSliderValueElement.innerHTML = values[handle]; $('.slider--updatedWithin__variable').hide(); $('.slider--updatedWithin__label').show(); } else{ $('.slider--updatedWithin__label').hide(); $('.slider--updatedWithin__variable').show(); }
});
/* ===== / Profile Updated Within Slider ===== */
Developer | Adam Lowenthal |
Username | alowenthal |
Uploaded | October 12, 2022 |
Rating | 3 |
Size | 48,147 Kb |
Views | 28,336 |
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 |
Agile Burndown Chart | 4,366 Kb |
Slider | 48,147 Kb |
Blog List -- BnC | 5,011 Kb |
Spinning Animated Vinyl Record | 5,968 Kb |
Spotify Artist Page UI | 14,961 Kb |
Google Maps Directions Sidebar | 3,884 Kb |
A Pen by Adam Lowenthal | 5,504 Kb |
Flexbox Responsive Grid Tiles | 2,030 Kb |
Dashboard Focal Tags | 2,981 Kb |
Sheet Music Animated Notes | 6,029 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 |
Twitch | SarahDunlap | 2,937 Kb |
IPhone5S SVG Space Grey | Onlinechris | 75,035 Kb |
FreeCodeCamp - Simon Game | Ivhed | 8,481 Kb |
Fluid Responsive Typography | Jonmilner | 4,205 Kb |
Reviews and Ratings Star | Zbnmstry | 1,591 Kb |
Sign Up Form | Sicontis | 5,272 Kb |
A Pen by James Podles | Jpod | 2,656 Kb |
Countdown Timer | Massiebn | 3,001 Kb |
CSS background-size - GSAP | Jonathan | 2,209 Kb |
Simple blog concept | Drew_mc | 2,666 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!