Image Hover
How do I make an image hover?
A nice image hover that reveals text on rollover. What is a image hover? How do you make a image hover? This script and codes were developed by Boyd Massie on 28 November 2022, Monday.
Image Hover - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Image Hover</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script type="text/javascript" src="https://code.jquery.com/jquery-latest.pack.js"></script>
<div class="wrap-thin demo-thin"> <div class="viewport"> <a href="#"> <span class="dark-background">Northern Saw-whet Owl <em>Photo by Matt Bango</em></span> <img src="http://farm4.static.flickr.com/3471/3959900087_48d1107093.jpg" alt="Northern Saw-Whet Owl" /> </a> </div> <div class="viewport no-margin"> <a href="#"> <span class="dark-background">Red-shouldered Hawk <em>Photo by Matt Bango</em></span> <img src="http://farm4.static.flickr.com/3645/3478879694_029e078d4d.jpg" alt="Red-shouldered Hawk" /> </a> </div> <div class="viewport"> <a href="#"> <span class="dark-background">Blue-headed Vireo <em>Photo by Matt Bango</em></span> <img src="http://farm4.static.flickr.com/3578/3478189088_1d0503acb1.jpg" alt="Blue-headed Vireo" /> </a> </div> <div class="viewport no-margin"> <a href="#"> <span class="dark-background">Wood Thrush <em>Photo by Matt Bango</em></span> <img src="http://farm4.static.flickr.com/3630/3486648997_b50b7670d1.jpg" alt="Wood Thrush" /> </a> </div>
</div> <script src="js/index.js"></script>
</body>
</html>
Image Hover - Script Codes CSS Codes
body { font-family: 'Helvetica Neue', Helvetica, Arial, serif; font-size: 62.5%; margin: 0; padding: 0;
}
.wrap-thin { margin: 0 auto; width: 921px;
}
.demo-thin { margin-top: 15px;
}
a { text-decoration: none;
}
/* --- Container configuration ---------------------------------------------------------- */
.viewport { border: 3px solid #eee; float: left; height: 299px; margin: 0 9px 9px 0; overflow: hidden; position: relative; width: 450px;
}
/* This is so that the 2nd thumbnail in each row fits snugly. You will want to add a similar class to the last thumbnail in each row to get rid of the margin-right. */
.no-margin { margin-right: 0;
}
/* --- Link configuration that contains the image and label ----------------------------- */
.viewport a { display: block; position: relative;
}
.viewport a img { height: 332px; left: -20px; position: relative; top: -20px; width: 500px;
}
/* --- Label configuration -------------------------------------------------------------- */
.viewport a span { display: none; font-size: 3.0em; font-weight: bold; height: 100%; padding-top: 120px; position: absolute; text-align: center; text-decoration: none; width: 100%; z-index: 100;
}
.viewport a span em { display: block; font-size: 0.45em; font-weight: normal;
}
/* --- Dark hover background ------------------------------------------------------------ */
.dark-background { background-color: rgba(15, 15, 15, 0.6); color: #fff; text-shadow: #000 0px 0px 20px;
}
.dark-background em { color: #ccc;
}
Image Hover - Script Codes JS Codes
$(document).ready(function() { $('.viewport').mouseenter(function(e) { $(this).children('a').children('img').animate({ height: '299', left: '0', top: '0', width: '450'}, 100); $(this).children('a').children('span').fadeIn(200); }).mouseleave(function(e) { $(this).children('a').children('img').animate({ height: '332', left: '-20', top: '-20', width: '500'}, 100); $(this).children('a').children('span').fadeOut(200); }); });
Developer | Boyd Massie |
Username | massiebn |
Uploaded | November 28, 2022 |
Rating | 4.5 |
Size | 2,622 Kb |
Views | 10,120 |
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 |
Desaturate an image with CSS | 1,505 Kb |
Round-A-Bout Image Showcase | 7,431 Kb |
QuickFlip | 2,109 Kb |
Fancy Image Showcase With Timer Bar | 10,579 Kb |
Background Video | 1,806 Kb |
Page Peel | 2,153 Kb |
Drag and Drop Images | 1,821 Kb |
Snow Falling JS | 7,771 Kb |
Responsive Dropdown Menu | 3,922 Kb |
Inline Frame PDF | 1,908 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 |
Dribbble Template | ExtremelyGinger | 2,204 Kb |
Board Site | IndianaLuft | 10,542 Kb |
CSS3 Form Page Design | Rssatnam | 3,613 Kb |
Clock Face Idea | Chrisburnell | 3,196 Kb |
Minimal Material Design Form Input | Koenigsegg1 | 3,076 Kb |
APortfolio | Skybutterfly | 5,174 Kb |
A Pen by Shidhin | Shidhincr | 5,015 Kb |
The Fly | GianlucaGuarini | 3,405 Kb |
Text Blocks Over Image, Updated | KatieK2 | 3,122 Kb |
Progressively reveal dots on a Bezier curve | GreenSock | 2,489 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!