Hover zoom on a background image
How do I make an hover zoom on a background image?
What is a hover zoom on a background image? How do you make a hover zoom on a background image? This script and codes were developed by Anya Craig on 26 August 2022, Friday.
Hover zoom on a background image - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Hover zoom on a background image</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"> <div class="ducklings" data-scale="2.5"></div>
</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Hover zoom on a background image - Script Codes CSS Codes
.container { border: 2px solid black; height: 400px; width: 800px; margin: 0 auto; overflow: hidden;
}
.ducklings { width: 100%; height: 100%; background-size: cover; background-image: url("http://wallpapercave.com/wp/BcYmeHM.jpg"); cursor: crosshair; transition: .3s transform ease-in-out;
}
Hover zoom on a background image - Script Codes JS Codes
$(".ducklings") .on("mouseover", function(){ $(this).css({"transform": "scale(" + $(this).attr("data-scale") + ")" });
}) .on("mouseout", function(){ $(this).css({"transform": "scale(1)", 'transform-origin': '50% 50% 0' });
}) .on("mousemove", function(e){ $(this).css({"transform-origin": ((e.pageX - $(this).offset().left) / $(this).width()) * 100 + "% "+ ((e.pageY - $(this).offset().top) / $(this).height()) * 100 + '%' });
})
Developer | Anya Craig |
Username | AnyaCraig |
Uploaded | August 26, 2022 |
Rating | 3 |
Size | 1,957 Kb |
Views | 50,600 |
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 |
Simple Responsive Gallery | 1,595 Kb |
Bee flight animation using Snap.svg | 4,355 Kb |
Signpost rotation animation | 3,107 Kb |
Cupid in Pursuit | 4,193 Kb |
Text with Background Gradients and Text-Shadows | 2,501 Kb |
Drawing Tablet | 2,457 Kb |
Pawprints animation | 6,928 Kb |
Responsive Square with Background Image | 1,712 Kb |
Rainbow Pride Slide | 1,705 Kb |
Maple Blossom | 4,588 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 |
Sticky Navbar | Phantomesse | 5,106 Kb |
Count up | Alanshortis | 2,391 Kb |
Bloomberg Style Link Hover | Gil-- | 1,609 Kb |
CSS Bot Confusion | Jpod | 3,456 Kb |
Adding Items | Valhead | 4,008 Kb |
Pictos font library from CodePen | Jstam | 3,790 Kb |
Scifi-style Interative Form | Aaronchuo | 4,566 Kb |
Mini Profile | Frytyler | 3,828 Kb |
BSP Dungeon Generation | Xgundam05 | 5,326 Kb |
Simple checkbox style | Vncnz | 2,628 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!