Tryout_slider_done

Size
2,104 Kb
Views
26,312

How do I make an tryout_slider_done?

What is a tryout_slider_done? How do you make a tryout_slider_done? This script and codes were developed by Alexander Nastase on 21 August 2022, Sunday.

Tryout_slider_done Previews

Tryout_slider_done - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>tryout_slider_done</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"> <a href="#" class="prev">←</a> <a href="#" class="next">→</a> <div class="slides"> <article class="slide">slide 1</article> <article class="slide slide2">slide 2</article> <article class="slide slide3">slide 3</article> <article class="slide slide4">slide 4</article> </div>
</div> <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Tryout_slider_done - Script Codes CSS Codes

body {margin: 0; padding: 0;}
.prev, .next { color: red; position: fixed; top: 50%; font-size: 45px; text-decoration: none; z-index: 1;}
.next { right: 0; }
.slides { transition: margin .4s linear;}
.slide { color: white; background: navy; float:left; display:inline-block;}
.slide2 { background: yellow;}
.slide3 { background: indigo;}
.slide4 { background: green;}

Tryout_slider_done - Script Codes JS Codes

var viewportHeight = $(window).height();
var viewportWidth = $(window).width();
var slidesWidth = viewportWidth * 4;
var slidesHeight = $(window).height();
var currentSlide = 0;
var totalSlides = 4;
$('.container').css({'width': viewportWidth , 'height': viewportHeight});
$('.slides').css({'width': slidesWidth , 'height': slidesHeight});
$('.slides .slide').css({'width': viewportWidth , 'height': viewportHeight});
$('.next').on('click', function() { if (currentSlide + 1 < totalSlides) { currentSlide++; } else { currentSlide = 0; } changeSlide();
});
$('.prev').on('click', function() { if (currentSlide - 1 >= 0) { currentSlide--; } else { currentSlide = totalSlides - 1; } changeSlide();
});
function changeSlide() { console.log(currentSlide); $('.slides').css('margin-left', -100 * currentSlide + 'vw')
}
Tryout_slider_done - Script Codes
Tryout_slider_done - Script Codes
Home Page Home
Developer Alexander Nastase
Username anodpixels
Uploaded August 21, 2022
Rating 3
Size 2,104 Kb
Views 26,312
Do you need developer help for Tryout_slider_done?

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!

Alexander Nastase (anodpixels) Script Codes
Create amazing blog posts with AI!

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!