Infinite scrolling horizontal text

Developer
Size
2,438 Kb
Views
48,576

How do I make an infinite scrolling horizontal text?

Http://greensock.com/forums/topic/10230-what-is-the-best-method-for-scrolling-text-horizontally-across-a-div/. What is a infinite scrolling horizontal text? How do you make a infinite scrolling horizontal text? This script and codes were developed by Chrysto on 16 July 2022, Saturday.

Infinite scrolling horizontal text Previews

Infinite scrolling horizontal text - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Infinite scrolling horizontal text</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/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <button id="ov">Overflow Visible</button> <button id="oh">Overflow Hidden</button> <div class="holder"> <ul class="list"> <li>1</li> <li>2</li> <li>3</li> <li>4</li> <li>5</li> </ul> </div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Infinite scrolling horizontal text - Script Codes CSS Codes

body,div,ul,li,p {	margin:0;	padding:0;
}
/*	CUSTOM STYLES
*/
.holder {	position:relative;	top:100px;	left:100px;	width:200px;	height:150px;	background-color:red;	overflow:visible;
}
.holder.hide-overflow {	overflow:hidden;
}
ul.list {	position:relative;	display:inline-block;	background-color:#000;	list-style:none;
}
ul.list.cloned {	position:absolute;	top:0;	left:0;	background-color:lime!important;
}
ul.list li {	background-color:blue;	float:left;	width:200px;	height:150px;	text-align:center;	font-size:30px;
}

Infinite scrolling horizontal text - Script Codes JS Codes

var $holder = $(".holder");
var $list = $holder.find("ul.list");
var $clonedList = $list.clone();
var listWidth = $list.find("li").length * 200;
var endPos = $holder.width() - listWidth;
$list.add($clonedList).css({	"width" : listWidth + "px"
});
$clonedList.addClass("cloned").appendTo($holder);
//TimelineMax
var infinite = new TimelineMax({repeat: -1, paused: false});
var time = 5;
infinite.fromTo($list, time, {left:0}, {left: -listWidth, ease: Linear.easeNone}, 0);
infinite.fromTo($clonedList, time, {left:listWidth}, {left:0, ease: Linear.easeNone}, 0);
infinite.set($list, {left: listWidth});
infinite.to($clonedList, time, {left: -listWidth, ease: Linear.easeNone}, time);
infinite.to($list, time, {left: 0, ease: Linear.easeNone}, time);
//Pause/Play
$holder.on("mouseenter", function(){	infinite.pause();
}).on("mouseleave", function(){	infinite.play();
});
//Show/Hide overflow
$("#ov").on("click", function(){	$holder.removeClass("hide-overflow");
});
$("#oh").on("click", function(){	$holder.addClass("hide-overflow");
});
Infinite scrolling horizontal text - Script Codes
Infinite scrolling horizontal text - Script Codes
Home Page Home
Developer Chrysto
Username bassta
Uploaded July 16, 2022
Rating 3
Size 2,438 Kb
Views 48,576
Do you need developer help for Infinite scrolling horizontal text?

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!

Chrysto (bassta) 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!