Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="../reset.css" />
.textbox {
position: relative;
display: flex;
justify-content: center;
font-size: 50px;
margin-top: 100px;
letter-spacing: 20px;
.textbox ul {
list-style: none;
margin: 0;
padding: 0;
position: absolute;
top: 0;
width: 100%;
height: 100%;
overflow: hidden;
.textbox li {
position: absolute;
top: 55px;
transition: top .45s ease;
.textbox li:first-child {
top: 0;
.textbox li.up {
top: -55px;
.textbox li.up2 {
top: 0;
.text-switch-box {
position: relative;
width: 180px;
height: 100%;
<div class="textbox">
<div class="text-switch-box">
<ul id="text-switch-list">
<script src="../jquery.js"></script>
$(function() {
setInterval(function() {
let $li1 = $('#text-switch-list li:first-child');
let $li2 = $('#text-switch-list li:nth-child(2)');
$'transitionend', function() {
}, 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment