| 1 |
(function($) { |
| 2 |
function is_touch_device() { |
| 3 |
return (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)); |
| 4 |
} |
| 5 |
|
| 6 |
if (is_touch_device()) { |
| 7 |
$('.awsm-grid > .awsm-grid-card > figure').on('touchend', function(e) { |
| 8 |
if($(e.target).is('.awsm-grid > .awsm-grid-card > figure a') || $(e.target).is('.awsm-grid > .awsm-grid-card > figure a *')) return; |
| 9 |
e.preventDefault(); |
| 10 |
$(this).toggleClass('cs-hover'); |
| 11 |
}); |
| 12 |
} |
| 13 |
if (!is_touch_device()) { |
| 14 |
$('.awsm-grid-wrapper').addClass('no-touchevents'); |
| 15 |
} |
| 16 |
if (window.navigator.userAgent.indexOf("Windows NT 10.0")!= -1){ |
| 17 |
$('.awsm-grid-wrapper').addClass('no-touchevents'); |
| 18 |
} |
| 19 |
})(jQuery); |