(function($) { function is_touch_device() { return (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)); } $(window).on('load', function() { if ( ! is_touch_device() ) { $('.fl-node- .pp-flipbox-container').on('mouseenter', function(e) { e.preventDefault(); $(this).addClass('pp-hover'); }); $('.fl-node- .pp-flipbox-container').on('mouseleave', function(e) { e.preventDefault(); $(this).removeClass('pp-hover'); }); } $('.fl-node- .pp-flipbox-container').on('click', function(e) { $(this).toggleClass('pp-hover'); }); if( $('.fl-node- .pp-flipbox-front').outerHeight() > $('.fl-node- .pp-flipbox-back').outerHeight() ) { $('.fl-node- .pp-flipbox-back').css( 'height', $('.fl-node- .pp-flipbox-front').outerHeight() + 'px' ); } else { $('.fl-node- .pp-flipbox-front').css( 'height', $('.fl-node- .pp-flipbox-back').outerHeight() + 'px' ); } }); })(jQuery);