Toggle Overlay on UL
How do I make an toggle overlay on ul?
Toggle an overlay to act as an AJAX container over a UL item based on the list item chosen.. What is a toggle overlay on ul? How do you make a toggle overlay on ul? This script and codes were developed by Bryan Fillmer on 11 December 2022, Sunday.
Toggle Overlay on UL - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Toggle Overlay on UL</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <ul> <li><p>Test One <a href="#">Toggle</a></p></li> <li><p>Test Two <a href="#">Toggle</a></p></li> <li><p>Test Three <a href="#">Toggle</a></p></li> <li><p>Test Four <a href="#">Toggle</a></p></li> <li><p>Test Five <a href="#">Toggle</a></p></li> <li><p>Test Six <a href="#">Toggle</a></p></li> <li class="ajax-overlay"><div class="ajax-container">AJAX CAUSE YOLO <a href="#" class="close-ajax-overlay">Close It</a></div></li>
</ul> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Toggle Overlay on UL - Script Codes CSS Codes
body { margin: 0; padding: 0;
}
p { margin: 0; padding: 0; -webkit-transition: margin 0.6s ease-in-out; transition: margin 0.6s ease-in-out;
}
.slide-left { margin-left: -100%;
}
ul { position: relative; margin: 0; padding: 0;
}
li { display: block; width: 100%; padding: 20px; background: #3CB371;
}
li:nth-child(even) { background-color: #00FF7F;
}
.ajax-overlay { overflow: hidden; position: absolute; top: 0; right: 0; width: 0; height: 100%; margin: 0; padding: 0; background-color: #2E8B57; -webkit-transition: width 0.3s ease-in-out; transition: width 0.3s ease-in-out;
}
.full-width { width: 100%;
}
Toggle Overlay on UL - Script Codes JS Codes
var showOverlay = function() { $(this).closest('ul').find('p').addClass('slide-left'); $('.ajax-overlay').addClass('full-width'); return false;
}
var hideOverlay = function() { $(this).closest('ul').find('p').removeClass('slide-left'); $('.ajax-overlay').removeClass('full-width');
}
$('ul a').on('click', showOverlay);
$('ul a').on('dblclick', showOverlay);
$('.close-ajax-overlay').on('click', hideOverlay);
Developer | Bryan Fillmer |
Username | bfillmer |
Uploaded | December 11, 2022 |
Rating | 3 |
Size | 2,509 Kb |
Views | 8,096 |
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 |
Attribute Module CSS Grid Mixins | 5,014 Kb |
JS Playground | 3,242 Kb |
Basic Javascript Chaining | 2,399 Kb |
Prototype Angular JS Workout Log | 2,599 Kb |
Continued Angular Testbed | 2,239 Kb |
Regex Sensei | 1,551 Kb |
Angular Animation Playground | 2,894 Kb |
Project Euler Problem 17 | 2,739 Kb |
Attribute Modules for CSS | 5,810 Kb |
Five Programming Problems | 4,091 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 |
Pomodoro Clock | Osycon | 3,705 Kb |
Free css icon set v2 - one div | Ben_jammin | 0 Kb |
Drag and Drop Quiz | Cgspicer | 3,837 Kb |
Animate elements with fixed gradient | Badabam | 4,406 Kb |
Headroom.js demo | WickyNilliams | 3,982 Kb |
Flexbox Test | Icutpeople | 2,486 Kb |
Simple Login Form Template | Banunn | 3,571 Kb |
Gulpfile | Aimhigherwebdesign-amy | 1,765 Kb |
RPG Style Text Dialogue | Odylic | 2,635 Kb |
Force Counter | Kenlauguico | 2,732 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!