Image Hover

Developer
Size
2,622 Kb
Views
10,120

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 Previews

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); }); });
Image Hover - Script Codes
Image Hover - Script Codes
Home Page Home
Developer Boyd Massie
Username massiebn
Uploaded November 28, 2022
Rating 4.5
Size 2,622 Kb
Views 10,120
Do you need developer help for Image Hover?

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!

Boyd Massie (massiebn) Script Codes
Create amazing sales emails with AI!

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!