Hey there, I'm currently using this menu: spoilers.tumblr.com/tvschedule, and I have a script below. The functionality works well with the click event, but I'm having some trouble with the hovering effect. To make certain classes visible on hover, I first need to hide others, but I don't want them to stay hidden once the hovering is finished. It's a bit difficult to explain, so you'll have to see it in action on my page.
If anyone can assist me with this, I would really appreciate it. :)
P.S. I've attempted adding the class back after hovering, but that didn't achieve what I wanted. I also tried playing around with z-index in the CSS, but that didn't work out either.
<script type="text/javascript">
$(document).ready(function(){
$("#all").hover(function() {
$('.morenav').removeClass('hoverednow hoveredhiatus hoveredto hoveredfinished clickedfinished clickedto clickedhiatus clickednow');
$(this).closest(".morenav").toggleClass("hoveredhall")}
);
$("#now").hover(function() {
$('.morenav').removeClass('hoveredall hoveredhiatus hoveredto hoveredfinished clickedfinished clickedto clickedhiatus');
$(this).closest(".morenav").toggleClass("hoverednow")
}
);
$("#hiatus").hover(function() {
$('.morenav').removeClass('hoveredall hoverednow hoveredto hoveredfinished clickedfinished clickedto');
$(this).closest(".morenav").toggleClass("hoveredhiatus")
});
$("#to").hover(function() {
$('.morenav').removeClass('hoveredall hoveredhiatus hoverednow hoveredfinished clickedfinished');
$(this).closest(".morenav").toggleClass("hoveredto")
});
$("#finished").hover(function () {
$('.morenav').removeClass('hoveredall hoverednow hoveredto hoveredhiatus');
$(this).closest(".morenav").toggleClass("hoveredfinished")
});
$("#all").click(function() {
$('.morenav').removeClass('clickednow clickedhiatus clickedto clickedfinished');
$(this).closest(".morenav").toggledClass("clickedall")
});
$("#now").click(function() {
$('.morenav').removeClass('clickedhiatus clickedall clickedto clickedfinished');
$(this).closest(".morenav").toggleClass("clickednow")
});
$("#hiatus").click(function() {
$('.morenav').removeClass('clickednow clickedall clickedto clickedfinished');
$(this).closest(".morenav").toggleClass("clickedhiatus")
});
$("#to").click(function() {
$('.morenav').removeClass('clickednow clickedall clickedhiatus clickedfinished');
$(this).closest(".morenav").toggleClass("clickedto")
});
$("#finished").click(function() {
$('.morenav').removeClass('clickednow clickedall clickedhiatus clickedto');
$(this).closest(".morenav").toggleClass("clickedfinished")
});
});</script>
CSS
.morenav.hoveredall {background:#f0f0f0; position:fixed; z-index:9999999; -moz-transition-duration:1s;
-webkit-transition-duration:1s;
-o-transition-duration:1s;}
.morenav.clickedall {background:#f0f0f0; -moz-transition-duration:1s;
-webkit-transition-duration:1s;
-o-transition-duration:1s;}
.morenav.hoverednow {background:#6E0420; -moz-transition-duration:1s;
-webkit-transition-duration:1s;
-o-transition-duration:1s;}
.morenav.clickednow {background:#6E0420; -moz-transition-duration:1s;
-webkit-transition-duration:1s;
-o-transition-duration:1s;}
.morenav.hoveredhiatus {background:teal; -moz-transition-duration:1s;
-webkit-transition-duration:1s;
-o-transition-duration:1s;}
.morenav.clickedhiatus {background:teal; -moz-transition-duration:1s;
-webkit-transition-duration:1s;
-o-transition-duration:1s;}
.morenav.hoveredjean {background:#CFBE27 ; -moz-transition-duration:1s;
-webkit-transition-duration:1s;
-o-transition-duration:1s;}
.morenav.clickedto {background:#CFBE27 ; -moz-transition-duration:1s;
-webkit-transition-duration:1s;
-o-transition-duration:1s;}
.morenav.hoveredfinished {background:#FA6900 ;-moz-transition-duration:1s;
-webkit-transition-duration:1s;
-o-transition-duration:1s; }
.morenav.clickedfinished {background:#FA6900 ;-moz-transition-duration:1s;
-webkit-transition-duration:1s;
-o-transition-duration:1s; }