Hover button
How do I make an hover button?
Simple example of hover button with jquery. What is a hover button? How do you make a hover button? This script and codes were developed by Szymon Dziewoński on 23 December 2022, Friday.
Hover button - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Hover button </title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <nav> <ul> <li> <a href="" class="active"> <div> <img src="http://revelier.home.pl/but/button_hover.png"/> </div> <span>Main</span> </a> </li> <li><li> <a href=""> <div> <img src="http://revelier.home.pl/but/button_hover.png"/> </div> <span>button two</span> </a> </li> <li> <a href=""> <div> <img src="http://revelier.home.pl/but/button_hover.png"/> </div> <span>button three</span> </a> </li> <li> <a href=""> <div> <img src="http://revelier.home.pl/but/button_hover.png"/> </div> <span>button four</span> </a> </li> <li> <a href=""> <div> <img src="http://revelier.home.pl/but/button_hover.png"/> </div> <span>button five</span> </a> </li> </ul>
</nav> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Hover button - Script Codes CSS Codes
nav{ width: 765px; margin: 20px auto; position: relative;
}
nav ul li{ float:left; list-style-type: none;
}
nav ul li a{ width: 145px; height: 51px; display: block; background-image: url("http://revelier.home.pl/but/but.png"); color: #fff; text-decoration: none;
}
nav ul li a div{ width: 145px; height: 51px; overflow: hidden; position: absolute; z-index: 100;
}
nav ul li a span{ z-index: 101; position: absolute; text-transform: uppercase; font-size: 10px; font-family: arial, sans-serif; text-align: center; line-height: 55px; width: 145px;
}
Hover button - Script Codes JS Codes
$("nav ul li a.active img").css({ "margin-top": "-51px"
})
$("nav ul li a:not(.active)").hover(function(){ $(this).find("img").stop().animate({ "margin-top": "-51px" },{ queue : false, duration: 200 }); }, function() { $(this).find("img").stop().animate({ "margin-top": "0px" },{ queue : false, duration: 50 });
});
Developer | Szymon Dziewoński |
Username | SzymonDziewonski |
Uploaded | December 23, 2022 |
Rating | 3 |
Size | 2,147 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 |
Animated logo | 1,994 Kb |
Hover effect | 2,448 Kb |
Menu with hover slide effect | 2,026 Kb |
Earth animation | 1,991 Kb |
Vertical-align | 1,646 Kb |
Random count | 1,930 Kb |
Svg animation draw | 5,545 Kb |
Social Icons net animation | 2,689 Kb |
Simple loader | 1,919 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 keyframe onload animation. | Samueljseay | 1,706 Kb |
Starfield old school style | Bolloxim | 5,214 Kb |
Shopping List | Markmurray | 6,015 Kb |
CSS3 Fullscreen Background Slideshow | Leetech | 3,435 Kb |
Import shader in three.js | Khangeldy | 2,636 Kb |
A Pen by Eka Risyana | Risyana | 3,705 Kb |
BenU Maintenance Site | Ksherman | 4,893 Kb |
A Pen by Michael Parenteau | Michaelparenteau | 2,133 Kb |
P1 | Vivi_Lai | 1,533 Kb |
Responsive Pricing Table | Jeremycaris | 2,690 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!