You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,8 @@ Please note after `1.0` Semver will be followed using normal protocols.
28
28
***Feature** - Added [`position()`](https://next.semantic-ui.com/api/query/dimensions#position) method that replaces `containerPosition()` with enhanced API supporting multiple coordinate systems (global, local, relative) and proper empty selection handling.
29
29
***Feature** - Added [`pagePosition()`](https://next.semantic-ui.com/api/query/dimensions#pageposition) method for getting/setting element position relative to the document.
30
30
***Feature** - Added [`dimensions()`](https://next.semantic-ui.com/api/query/dimensions#dimensions) method returning comprehensive dimension information including content, padding, border, margin, and scroll dimensions.
31
-
***Feature** - Added [`isInViewport()`](https://next.semantic-ui.com/api/query/visibility#isinviewport) method for detecting viewport intersection with optional threshold and fully visible options.
31
+
***Feature** - Added [`intersects()`](https://next.semantic-ui.com/api/query/dimensions#intersects) method for checking element intersection with configurable threshold, side detection, and detailed intersection data.
32
+
***Feature** - Added [`isInView()`](https://next.semantic-ui.com/api/query/visibility#isinview) method for detecting viewport intersection with optional threshold and fully visible options.
32
33
***Feature** - Added [`positioningParent()`](https://next.semantic-ui.com/api/query/visibility#positioningparent) method that correctly identifies positioning contexts for both absolute and fixed elements, including modern CSS properties like transform, filter, perspective, contain, and will-change.
33
34
***Feature** - Added [`show()`](https://next.semantic-ui.com/api/query/visibility#show) method for showing hidden elements with optional `calculate` parameter to determine natural display values.
34
35
***Feature** - Added [`hide()`](https://next.semantic-ui.com/api/query/visibility#hide) method for hiding elements by setting display to 'none'.
Checks if all elements in the selection are within the viewport bounds.
355
-
356
-
> **Note** By default, this method checks visibility within the clipping parent (scrollable container). If no clipping parent exists, it falls back to the browser viewport. You can also specify a custom viewport element.
354
+
Checks if all elements are within the viewport bounds.
357
355
358
356
### Syntax
359
357
360
358
```javascript
361
-
$('selector').isInViewport()
362
-
$('selector').isInViewport(options)
359
+
$('selector').isInView()
360
+
$('selector').isInView(options)
363
361
```
364
362
365
363
### Parameters
366
364
367
365
| Name | Type | Description |
368
366
|-----------|---------|-------------|
369
-
| threshold | number | Minimum percentage (0-1) of element that must be visible. Defaults to `0` (any part visible). |
370
-
| fully | boolean |Whether element must be fully within viewport. Overrides threshold. Defaults to `false`. |
371
-
| viewport | Element\|Query |The viewport element to check against. Defaults to clipping parent, falls back to browser viewport. |
367
+
| threshold | number | Minimum percentage (0-1) visible. Defaults to `0`. |
368
+
| fully | boolean |Element must be fully within viewport. Defaults to `false`. |
369
+
| viewport | Element\|Query |Viewport element to check against. Defaults to clipping parent. |
372
370
373
371
### Returns
374
372
375
-
`boolean` - `true` if **ALL** elements meet the visibility criteria, `false`if **ANY** element doesn't meet criteria.
373
+
`boolean` - `true` if ALL elements meet criteria, `false`otherwise.
376
374
377
375
### Usage
378
376
379
377
```javascript
380
378
// Check if any part is visible in clipping parent (default)
381
-
if ($('#element').isInViewport()) {
379
+
if ($('#element').isInView()) {
382
380
console.log('Element is at least partially visible in container');
383
381
}
384
382
@@ -398,7 +396,7 @@ if ($('#tooltip').isInViewport({ viewport: $('#modal') })) {
398
396
}
399
397
400
398
// Check multiple elements (all must meet criteria)
401
-
if ($('.items').isInViewport()) {
399
+
if ($('.items').isInView()) {
402
400
console.log('All items are at least partially visible');
0 commit comments