Close button with css and jquery
How do I make an close button with css and jquery?
What is a close button with css and jquery? How do you make a close button with css and jquery? This script and codes were developed by Salman Raza on 02 November 2022, Wednesday.
Close button with css and jquery - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Close button with css and jquery</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <main> <div class="sub_cnt"> <button class="hover" title="Hover On Me"> <span class="arrow"></span> </button> </div> <div class="sub_cnt"> <button class="focus" title="Click On Me"> <span class="arrow"></span> </button> </div> <div class="sub_cnt"> <button class="for_active" title="Click On Me"> <span class="arrow"></span> </button> </div> </main> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Close button with css and jquery - Script Codes CSS Codes
@import url('https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900');
@import url('https://fonts.googleapis.com/css?family=Playball');
body { background-image: linear-gradient(45deg, #fad0c4 0%, #fad0c4 1%, #ffd1ff 100%);
}
* { box-sizing: border-box;
}
main { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; min-width:800px;
}
main:after { content: 'Salman Raza'; font-family: 'Playball', cursive; position: absolute; bottom: -90px; left: 50%; color: rgba(0, 0, 0, 0.017); font-size: 150px; line-height: 140px; white-space: nowrap; text-transform: lowercase; transform: translateX(-50%); pointer-events: none; z-index: -1;
}
.sub_cnt { display: inline-block; width: 250px; max-width: 350px; height: 150px; line-height: 150px; background-color: #fff; text-align: center; box-shadow: 0 0 15px rgba(0,0,0,0.2); border-radius: 5px; position: relative; margin: 0 10px 10px 0;
}
.sub_cnt:after { position: absolute; top: -100px; left: 50%; transform: translateX(-50%); font-size: 20px; font-family: 'Lato', sans-serif; text-transform: uppercase; letter-spacing: 4px;
}
.sub_cnt:nth-of-type(1):after { content: '::hover'; }
.sub_cnt:nth-of-type(2):after { content: '::focus'; }
.sub_cnt:nth-of-type(3):after { content: '::active'; }
/* Button styles */
button { vertical-align: middle; position: relative; width: 80px; height: 80px; background-color: transparent; overflow: hidden; border:1px solid #333; transition: all 0.4s ease-in-out 0s; cursor: pointer;
}
.arrow,.arrow:after, button:after, button:before { position: absolute; top: 50%; transform: translate(-50%, -50%) rotate(45deg); left: 50%; width: 3px; height: 30px; background-color: #000; transition: all 0.4s ease-in-out 0s;
}
.arrow:after, button:after, button:before { content: ''; }
.arrow:after { transform: translate(0px, -100px); }
button:before { transform: translate(-50%, -50%) rotate(-45deg); }
button:after { transform: translate(-60px, -75px) rotate(-45deg); }
button:focus, button:focus .arrow:focus {outline: none;}
button.hover:hover:after,
button.focus:focus:after,
button.active:after
{ transform: translate(0px, -14px) rotate(-45deg);
}
button.hover:hover:before,
button.focus:focus:before,
button.active:before
{ transform: translate(60px, 45px) rotate(-45deg);
}
button.hover:hover .arrow,
button.focus:focus .arrow,
button.active .arrow
{ transform: translate(-61px, 45px) rotate(45deg);
}
button.hover:hover:after,
button.hover:hover .arrow:after,
button.focus:focus:after,
button.focus:focus .arrow:after,
button.active:after,
button.active .arrow:after
{ background-color: #fff;
}
button.hover:hover,
button.focus:focus,
button.active
{ background-color: red; border-color: red;
}
Close button with css and jquery - Script Codes JS Codes
// active class $(".for_active").click(function(){ var clas = $(".for_active").attr('class'); if(clas=='for_active'){ $(this).addClass("active"); } else { $(this).removeClass("active"); } });
Developer | Salman Raza |
Username | salmanraza |
Uploaded | November 02, 2022 |
Rating | 3 |
Size | 2,661 Kb |
Views | 34,408 |
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 |
App design | 8,269 Kb |
Testimonial carousel | 3,457 Kb |
Hamburger Menu Animation | 2,580 Kb |
Radio Button Animation Pure CSS | 2,538 Kb |
Event short details Card view | 4,004 Kb |
Event card View | 3,817 Kb |
A Pen by Salman Raza | 8,050 Kb |
Product showcase | 3,787 Kb |
Progress with CSS variables | 2,863 Kb |
Short Premium Event Card View | 4,626 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 |
CSS3 Diamond | Rendro | 1,960 Kb |
A Pen by Matt Popovich | Mpopv | 3,349 Kb |
Ocean | Gordonnl | 2,817 Kb |
WRENCH - STAFF | Lolita-adams | 1,608 Kb |
Caputre Cam with JS | KimmoCommit | 2,795 Kb |
Simple animated hover effect | Pobee-norris | 3,044 Kb |
Rainbow Drops | Csbarnes | 2,365 Kb |
Zip Button test | Lje7462 | 1,932 Kb |
Button fills | Zubfatal | 5,205 Kb |
A Different Type of Gallery | DonPage | 2,950 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!