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: README.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ javascript-detect-element-resize
4
4
A Cross-Browser, Event-based, Element Resize Detection.
5
5
6
6
In short, this implementation does NOT use an internal timer to detect size changes (as most implementations I found do).
7
-
It uses [overflow and underflow events][2] on most browsers, and the ['onresize' event][5] on IE10 and below.
7
+
It uses `scroll`events on most browsers, and the [`onresize` event][5] on IE10 and below.
8
8
9
-
NOTE: On IE11, due to lack of support for the above events, it only detects changes through a MutationObserver; i.e. only javascript generated resize changes and not CSS pseudo classes e.g. :hover, CSS animations, etc.
9
+
The method used not only detects javascript generated resize changes but also changes made from CSS pseudo classes e.g. :hover, CSS animations, etc.
10
10
11
11
About the libraries
12
12
===================
@@ -15,11 +15,9 @@ I was searching for a library that allowed me to detect when an DOM element chan
15
15
1. only available as jQuery libraries (so no standalone Javascript)
16
16
2. all had terrible performance (because all of them use timers to intermittently poll the size of the elements to detect a change).
17
17
18
-
Then I came across this [great post][1] on [Back Alley Coder][3] about using [overflow and underflow events][2] to do event-based element resize detection; and it works great without consuming resources at all (just like any other browser originated event).
18
+
Then I came across this [great post][1] on [Back Alley Coder][3] about using ~~[overflow and underflow events][2]~~[`scroll` events][2] to do event-based element resize detection; and it works great without consuming resources at all (just like any other browser originated event).
19
19
20
-
On the other hand, most new browsers implement [WC3 DOM4 MutationObservers][4], which allows to observe property changes and hence indirectly watch for resize changes.
21
-
22
-
The libraries on this repository are just a concrete implementation of a mixture of the above technologies/techniques.
20
+
The libraries on this repository are just a ready-to-use implementation of the above, one pure javascript and the other a jQuery plugin version (just for convenience).
23
21
24
22
Libraries
25
23
=========
@@ -60,12 +58,7 @@ Works great on:
60
58
61
59
- Chrome
62
60
- Firefox
63
-
- IE 10 and below (tested on 10, 9, 8 and 7)
64
-
65
-
Works but limited:
66
-
67
-
- IE 11: due to lack of onresize/overflow events, it only detects changes through a MutationObserver;
68
-
i.e. only javascript generated resize changes and not CSS pseudo classes e.g. :hover, CSS animations, etc.
61
+
- IE 11 and below (tested on 11, 10, 9, 8 and 7)
69
62
70
63
Doesn't work on:
71
64
@@ -81,10 +74,16 @@ TODO
81
74
82
75
Release Notes
83
76
=============
77
+
v0.5
78
+
----
79
+
80
+
- It is now fully compatible with IE11.
81
+
- Rework of the libraries using the new scroll-event-based code of [Back Alley Coder][1]. For the pure javascript version I pretty much used the original code from [Back Alley Coder][1] and only had to add code to dynamically insert the styling for the resize-triggers.
82
+
84
83
v0.4.1
85
84
----
86
85
87
-
- Fix for jQuery 'resize' method overlapping
86
+
- Fix for jQuery 'resize' method overlapping.
88
87
89
88
v0.4
90
89
----
@@ -106,8 +105,8 @@ v0.2
106
105
v0.1
107
106
----
108
107
109
-
- Implementation based on the [works][1] of [Back Alley Coder][3]
110
-
- Adds jQuery plugin version
108
+
- Implementation based on the [works][1] of [Back Alley Coder][3].
0 commit comments