I´m trying to add a hover function which adds a class to my header. I already got this code which does the same but on scroll.
$(document).ready(function(){
jQuery(window).trigger('resize').trigger('scroll');
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 1 ) {
header.removeClass('scroll').addClass("cover");
$('#phantom').show();
$('#phantom').css('height', Heightcalculate+'px');
} else {
header.removeClass("cover").addClass('scroll');
$('#phantom').hide();
}
});
Is there a way to edit this existing code so it does the same but on hover? i tried everything i could think of and it wouldn´t work. Thanks in advance.
.hover()function?$("elemnt").hover()