# blockenberg/2.0.7/blocks/hover-card/frontend.js

Blockenberg — 600+ Advanced Gutenberg Blocks &amp; AI Agent for WordPress Block Editor, version 2.0.7. 27 lines.

- Page: https://pluginprobe.com/plugins/blockenberg/2.0.7/code/blocks/hover-card/frontend.js
- Raw: https://pluginprobe.com/plugins/blockenberg/2.0.7/raw/blocks/hover-card/frontend.js
- Modified: 2026-03-06T12:32:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/blockenberg/2.0.7/code/blocks/hover-card/frontend.js#L10-L20`.

```javascript
/* Hover Card — frontend.js */
/* Primary reveal is CSS-driven. This adds touch-device support. */
( function () {
  function init() {
    document.querySelectorAll( '.bkhc-card' ).forEach( function ( card ) {
      card.addEventListener( 'touchstart', function () {
        card.classList.toggle( 'bkhc-touch-active' );
      }, { passive: true } );
    } );

    // Close touch-active when tapping outside
    document.addEventListener( 'touchstart', function ( e ) {
      document.querySelectorAll( '.bkhc-card.bkhc-touch-active' ).forEach( function ( card ) {
        if ( ! card.contains( e.target ) ) {
          card.classList.remove( 'bkhc-touch-active' );
        }
      } );
    }, { passive: true } );
  }

  if ( document.readyState === 'loading' ) {
    document.addEventListener( 'DOMContentLoaded', init );
  } else {
    init();
  }
} )();

```
