0.3.8 • Published 4 years ago

@codin/cwc-intersection v0.3.8

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

npm version

Intersection Element

Element for detecting intersection.

properties

disabled?: bool: false, reflect: true

When disabled the intersection adapter is removed

once?: bool: false

If true, the element wil await first intersection, then set it self as diabled.

margin?: string

Intersection offset, just like normal css margins.

threshold?: string|float[]

Decimal or CSV decimals .1,.5,.9 when used from html. flaot array when set by JS

Events

  • intersection triggerd when intersection
  • intersect-in triggerd when intersecting
  • intersect-out triggerd when not intersecting

Example

<style>
 cwc-intersection {
  border: 1px solid black;
  opacity: .5;
 }
 cwc-intersection[intersected] {
  border-color: red;
 }
 cwc-intersection[intersecting] {
  opacity: 1;
 }
</style>
<cwc-intersection treshold="1">
 <span>Foo Bar</span>
</cwc-intersection>
0.3.8

4 years ago

0.3.7

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

5 years ago

2.0.0

5 years ago

0.0.2

6 years ago

0.0.1

6 years ago