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 demo - Complete | 5,291 Kb |
You are getting very sleepy... | 3,242 Kb |
3D dancing dots | 2,334 Kb |
500 coffee cup icons | 3,169 Kb |
Steps Sprite Animation | 1,942 Kb |
Spring physics with CSS variables | 3,591 Kb |
Neon glow letters | 2,595 Kb |
Basic CSS animation and transition example | 2,915 Kb |
Net magazine demo - Step 3 | 5,295 Kb |
Net magazine example - Start | 4,830 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 |
CSS Chat Bubbles | Boylett | 2,094 Kb |
A Pen by Mike Otis | Mikeotis | 3,185 Kb |
Pomodoro Clock | Osycon | 3,705 Kb |
SVG email test v2.0 | M_J_Robbins | 2,090 Kb |
Drawing a Terminal with CSS | Lachlanjc | 3,185 Kb |
Cartoon Bomb | Tcmulder | 4,929 Kb |
Text Blocks Over Image, Updated | KatieK2 | 3,122 Kb |
CSS Letter animations | Sladix | 2,116 Kb |
CSS3 Snow Animation | NickyCDK | 1,695 Kb |
Geildanke typography | Fischaela | 3,249 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!