Simulate Hover on Mobile Device
Hi folks,
I am using jQuery for my drop down menus on a website. When the mouse hovers over an ul the li items appear and drop down. Everything works fine.
However when I view the site on a mobile device then a problem arises. there is no hover event.
Below is the jQuery code I am using:
<script type="text/javascript"> $(document).ready(function(){ $("#nav-one li").hover( function(){ $("ul", this).fadeIn(800); }, function() { } ); if (document.all) { $("#nav-one li").hoverClass ("sfHover"); } }); $.fn.hoverClass = function(c) { return this.each(function(){ $(this).hover( function() { $(this).addClass(c); }, function() { $(this).removeClass(c); } ); }); }; </script>
Can this be modifed so that an onCLick can be used to replace the onHover on mobile devices ?
Thanks,
J