Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. $(function() {
  2. // Check if it is iOS
  3. var isiOS = (navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false);
  4.  
  5. if(isiOS === true) {
  6.  
  7. // Store -webkit-tap-highlight-color as this gets set to rgba(0, 0, 0, 0) in the next part of the code
  8. var tempCSS = $('a').css('-webkit-tap-highlight-color');
  9.  
  10. $('body').css('cursor', 'pointer') // Make iOS honour the click event on body
  11. .css('-webkit-tap-highlight-color', 'rgba(0, 0, 0, 0)'); // Stops content flashing when body is clicked
  12.  
  13. // Re-apply cached CSS
  14. $('a').css('-webkit-tap-highlight-color', tempCSS);
  15.  
  16. }
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement