I have used JQuery to add a class to an element(.bg1) when the user hovers over another element (.box1). This works fine on desktops my problem is that when viewed on a mobile device because mobiles do not have a mouse, the hover effect can only be seen when the user taps the screen.
This would be fine if it was just a soft touch. The strange thing is that I also have another div that when hovered it changes an element. In this case it is a child element so I used the css :hover pseudo class to achieve this and it works perfectly on desktops and mobiles. However the jQuery .hover seems to act differently from the css :hover.
Is there a way to have the jQuery .hover act the same as the css :hover.
jQuery('.box1').hover(
function(){jQuery('.bg1').addClass('shown') },
function(){jQuery('.bg1').removeClass('shown') }
);