Seeking to create a unique video hover effect on an image where, when the mouse hovers over it, a video pops up similar to examples found on this website.
I have been grappling with finding a solution for this issue over the past few months.
Does anyone possess the knowledge and skills to achieve this?
This relates to an image hover effect that I have successfully implemented. Instead of the image popping up, is there a way to make a video pop up in the same manner?
<html>
<head>
<title>Test</title>
<script type="text/javascript" src="js/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('div.thumbnail-item').mouseenter(function(e) {
x = e.pageX - $(this).offset().left;
y = e.pageY - $(this).offset().top;
$(this).css('z-index','15')
.children("div.tooltip")
.css({'top': y + 10,'left': x + 20,'display':'block'});
}).mousemove(function(e) {
x = e.pageX - $(this).offset().left;
y = e.pageY - $(this).offset().top;
$(this).children("div.tooltip").css({'top': y + 10,'left': x + 20});
}).mouseleave(function() {
$(this).css('z-index','1')
.children("div.tooltip")
.animate({"opacity": "hide"}, "fast");
});
});
</script>
<style>
.thumbnail-item {
position: relative;
float: left;
margin: 0px 5px;
}
.thumbnail-item a {
display: block;
}
.thumbnail-item img.thumbnail {
border:3px solid #ccc;
}
.tooltip {
display: none;
position: absolute;
padding: 8px 0 0 8px;
}
.tooltip span.overlay {
background: url(images/overlay.png) no-repeat;
position: absolute;
top: 0px;
left: 0px;
display: block;
width: 350px;
height: 200px;
}
</style>
</head>
<body>
<div class="thumbnail-item">
<a href="#"><img src="images/Capture1.jpg" class="thumbnail"/></a>
<div class="tooltip">
<img src="images/2 Davis Road.jpg" alt="" width="330" height="185" />
<span class="overlay"></span>
</div>
</div>
<div class="thumbnail-item">
<a href="#"><img src="images/Capture2.jpg" class="thumbnail"/></a>
<div class="tooltip">
<img src="images/Camberwell Town Hall, Roof Restoration.jpg" alt="" width="330" height="185" />
<span class="overlay"></span>
</div>
</div>
<div class="thumbnail-item">
<a href="#"><img src="images/Capture3.jpg" class="thumbnail"/></a>
<div class="tooltip">
<img src="images/Children.jpg" alt="" width="330" height="185" />
<span class="overlay"></span>
</div>
</div>
<div class="clear"></div>