So I am currently creating a "button" with multiple images within it like a slideshow and whenever I MouseOver it, the image changes to another image.
However whenever the slideshow image changes, the MouseOver effect gets removed to a MouseOut state since technically the mouse is no longer on the image.
I also tried having a fade effect for my button however most of my searches lead to using hover functions instead of MouseOver and MouseOut.
So I am wondering if Hover is better than MouseOver in terms of it's potential capabilities?
Is it possible to pause the slideshow event on hover, etc? And how can I go about doing it?
Here is my current code:
function.js
$(function () {
$('#01 img:gt(0)').hide();
setInterval(function () {
$('#01 :first-child').fadeOut(1500)
.next('img').fadeIn(1500)
.end().appendTo('#01');
},
3000);
});
$(document).ready(function () {
$("#image1").mouseover(function () {
$(this).attr("src", "images/board_01_over.jpg");
});
$("#image1").mouseout(function () {
$(this).attr("src", "images/board_01_01.jpg");
});
});
main.css
#board {
float: left;
width: 998px;
overflow: hidden;
}
.fadein {
float: left;
position: relative;
width: 240px;
height: 140px;
margin: 1px 1px 1px 1px;
}
.fadein img {
position: absolute;
left: 0;
top: 0;
height: 140px;
opacity: 0.6;
overflow: hidden;
}
.fadein img:hover {
opacity: 1;
}
Main.html
<div id="board">
<div class="fadein" id="01">
<img src="images/board_01_01" id="image1" />
<img src="images/board_01_02.jpg" id="image2" />
</div>
</div>