First, just determine if you are browsing with a mobile device:
Mobile is here to add MouseEnter and MouseLeave events to the corresponding element only when it is no longer accessed on the mobile device.
if (!navigator.useragent.match (/mobile/i)) { $ ('. Nav-dots span '). MouseEnter (function() { $ (this). css (' Background-color ', ' rgba (0, 0, 0, 0.2)!important'); }); $ ('. Nav-dots span '). MouseLeave (function() { $ (this). CSS (' Background-color ', ' Rgba (255, 255, 255, 0.2)!important ');} );
---------------------------------------------------------------------------------------------------------
Second, you need to get a detailed type of mobile device:
$ (document). Ready (function() { varIsMobile ={Android:function() { returnNavigator.userAgent.match (/android/i)?true:false; }, BlackBerry:function() { returnNavigator.userAgent.match (/blackberry/i)?true:false; }, IOS:function() { returnNavigator.userAgent.match (/iphone|ipad|ipod/i)?true:false; }, Windows:function() { returnNavigator.userAgent.match (/iemobile/i)?true:false; }, any:function() { return(Ismobile.android () | | ismobile.blackberry () | | Ismobile.ios () | |ismobile.windows ()); } }; if(Ismobile.any ()) {$ ('. Main_header '). Hide (); }});
JQuery Judging is not mobile device browsing