1. Utilities
  2. isOutside

Utilities

isOutside

Reactive function for telling that mouse is inside or outside of an element.

Demo

undefined
Hover Me

Usage

        <script>
  import { onMount } from "svelte";
  import { isOutside } from "sveltronics";

  let myEle;
  let outside;

  onMount(() => {
    outside = isOutside(myEle);
  })
</script>

<div bind:this={myEle}>
  Hover Me
</div>
<div>{$outside}</div>