Adding Items
How do I make an adding items?
What is a adding items? How do you make a adding items? This script and codes were developed by Val Head on 07 August 2022, Sunday.
Adding Items - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Adding Items</title> <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! */ body { background: #B7C9E5; color: #F4F4F4; font-family: 'Dosis', Helvetica, Arial, sans-serif; font-weight: 600;
}
section { width: 40%; margin: 4em auto; overflow: hidden;
}
ul { list-style: none; margin: 0 0 .5em 0; padding: 0;
}
ul li { text-transform: uppercase; padding: 10px 0 0 5%; margin: 0; height: 30px; display: block; background: #141619; border-bottom: 1px solid rgba(252, 252, 252, 0.1);
}
button { width: 50%; padding: .75em 0; float: left; border: none; text-transform: uppercase; color: white; background: #419FE8;
}
.remove { background: #A6365A;
}
.new-item { max-height: 0; opacity: 0; transform: translateX(-600px); animation: openList 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards, itemEnter 0.3s 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards, itemHighlight 2s 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}
.old-item { animation: itemExit 0.75s cubic-bezier(0.245, -0.09, 0.735, 0.045) forwards;
}
@keyframes openList { to { max-height: 40px; }
}
@keyframes itemEnter { to { opacity: 1; transform: translateX(0); }
}
@keyframes itemExit { 15%, 30% { background: #A6365A; opacity: 1; transform: translateX(0); } 100% { opacity: 0; transform: translateX(600px); }
}
@keyframes itemHighlight { 5%, 60% { background: #419FE8; } 100% { background: #141619; }
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <link href='http://fonts.googleapis.com/css?family=Dosis:600' rel='stylesheet' type='text/css'>
<section>
<div class="sample-list"> <ul> <li>Milk</li> <li>Cookies</li> <li>Ice Cream</li> <li>Bread</li> </ul> </div> <button class="add">Add</button> <button class="remove">Remove</button>
</section> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Adding Items - Script Codes CSS Codes
body { background: #B7C9E5; color: #F4F4F4; font-family: 'Dosis', Helvetica, Arial, sans-serif; font-weight: 600;
}
section { width: 40%; margin: 4em auto; overflow: hidden;
}
ul { list-style: none; margin: 0 0 .5em 0; padding: 0;
}
ul li { text-transform: uppercase; padding: 10px 0 0 5%; margin: 0; height: 30px; display: block; background: #141619; border-bottom: 1px solid rgba(252, 252, 252, 0.1);
}
button { width: 50%; padding: .75em 0; float: left; border: none; text-transform: uppercase; color: white; background: #419FE8;
}
.remove { background: #A6365A;
}
.new-item { max-height: 0; opacity: 0; transform: translateX(-600px); animation: openList 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards, itemEnter 0.3s 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards, itemHighlight 2s 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}
.old-item { animation: itemExit 0.75s cubic-bezier(0.245, -0.09, 0.735, 0.045) forwards;
}
@keyframes openList { to { max-height: 40px; }
}
@keyframes itemEnter { to { opacity: 1; transform: translateX(0); }
}
@keyframes itemExit { 15%, 30% { background: #A6365A; opacity: 1; transform: translateX(0); } 100% { opacity: 0; transform: translateX(600px); }
}
@keyframes itemHighlight { 5%, 60% { background: #419FE8; } 100% { background: #141619; }
}
Adding Items - Script Codes JS Codes
var foodItems = ["Wine", "Cheese", "Pizza", "Cupcakes", "Bananas", "Apples", "Oranges", "Granola", "Cereal"];
$(".add").on("click", function() { var insertPoint = $(this).parent().find("li:nth-child(3)"); $("<li />", { 'text': foodItems[randomInt(0,foodItems.length-1)], 'class': "new-item" }).insertAfter(insertPoint);
});
$(".remove").on("click", function() { $(this).parent().find("li:nth-child(4)").removeClass('new-item').addClass('old-item'); $('.old-item').bind( 'animationend webkitAnimationEnd', function(event) {onAnimationEnd(event); });
});
function onAnimationEnd(e) { if ($('.old-item')) { $('.old-item').remove(); }
}
function randomInt(min, max) { return Math.floor(Math.random() * (max+1-min)) +min;
}

Developer | Val Head |
Username | valhead |
Uploaded | August 07, 2022 |
Rating | 4.5 |
Size | 4,008 Kb |
Views | 26,299 |
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 |
Net magazine example - Start | 4,830 Kb |
Net magazine demo - Complete | 5,291 Kb |
Listening for CSS animation events | 2,665 Kb |
Neon glow letters | 2,595 Kb |
You are getting very sleepy... | 3,242 Kb |
3D dancing dots | 2,334 Kb |
Listening for Animation Events With JavaScript | 2,727 Kb |
Steps Sprite Animation | 1,942 Kb |
Geometric Pattern Mask | 2,527 Kb |
500 coffee cup icons | 3,169 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 |
Ball bouncing loading animation | Adam2326 | 3,144 Kb |
Google Maps API Ground Overlay | Boycetrus | 2,961 Kb |
Base-Style | Daniel_gooss | 2,614 Kb |
Large canvas mousemove experiment | Jibbon | 2,885 Kb |
Filtre ile Arama Kutusu - Search Box with Filter | AyhanALTINOK | 3,448 Kb |
Scroll using CSS | Casperovic | 2,159 Kb |
JQuery exercise | Brian-baum | 3,780 Kb |
3D-box | Parthviroja | 2,346 Kb |
Revolving Text Landing Page Trial | TimRuby | 2,976 Kb |
TweetBox with React JS | J0zelito | 3,325 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!