Skip to content

Commit c7e6623

Browse files
committed
3.4.0
- NEW: ScrollTrigger.matchMedia() method that lets you easily set things up according to breakpoints and ScrollTrigger will automatically revert and kill any ScrollTriggers associated with the breakpoints that don't match. This makes it much simpler to make things behave differently on mobile devices and desktops, for example. - NEW: ScrollTrigger.scrollerProxy() method that makes it easier to integrate smooth scrolling effects by setting up proxy getter/setters for the scrollTop/scrollLeft properties of specific scrollers. - NEW: ScrollTrigger.saveStyles() method lets you record all the inline styles for any elements so that when ScrollTrigger does a refresh and reverts things internally (to do measurements), those elements have their inline styles fully reverted. This is particularly helpful when you have tweens/animatioons that add inline styles. Even if you rewind the tweens, that doesn't REMOVE inline styles, thus if you have CSS rules that should affect the elements, they won't because the inline ones (from the tweens) are more specific. - NEW: ScrollTrigger.config() recognizes a new "autoRefreshEvents" property that controls which events automatically trigger a ScrollTrigger.refresh(). It's a comma-delimited list with any of the following: "load,resize,visibilitychange,DOMContentLoaded" (and that's what it is by default). - NEW: globalTime() method on all animations lets you convert a local playhead time to the global time. For example, if a tween starts 5 seconds in and you run tween.globalTime(1) it would return 6 (assuming a timeScale of 1). It does factor in the timeScale of all ancestor timelines. - IMPROVED: you can revert fromTo() tweens to their previous state with a negative number like animation.progress(-1) or animation.totalTime(-1). - IMPROVED: if you kill() a ScrollTrigger, it will also revert any associated animation (and kill that too). - IMPROVED: if you change the duration of a tween after it has begun, it will make that change smoothly (adjust the startTime() unless the parent timeline has smoothChildTiming set to false). See https://greensock.com/forums/topic/24596-flicker-on-updating-duration-on-repeating-animation/ - IMPROVED: ScrollTrigger automatically sets scroll-behavior to "auto" if there's a "snap" defined because scroll-behavior: smooth would interfere with snapping. - IMPROVED: ScrollTrigger doesn't force a refresh() when returning to an inactive/hidden tab if the browser window wasn't resized. - FIXED: if anticipatePin was set on a ScrollTrigger, a refresh() (or window resize) could trigger it inadvertently. - FIXED: in certain circumstances with ScrollTrigger pins, the layout may not be properly refreshed when resizing. - FIXED: if you tween a generic object with a property that has a decimal value to a string with a decimal, it could cast it as a string instead of keeping it as a number. See https://greensock.com/forums/topic/24564-random-value-is-a-string/ - FIXED: if you kill() or disable() a ScrollTrigger that had a toggleClass, it may not reset things properly. - FIXED: worked around Firefox bug that affects borderColor (Firefox always reports the computed value s literally nothing, ""). See https://greensock.com/forums/topic/24583-how-to-return-colors-that-i-had-after-reverse/ - FIXED: worked around a bug in some browsers (like iOS Safari) where the browser would misreport the scroll position slightly, causing the snap of a ScrollTrigger to get halted (because it auto-killed the tween, thinking the user had interacted with the scroll). - FIXED: if you clearProps "transformOrigin", that inline style wasn't properly removed. See #393 - FIXED: ScrollTrigger may refresh more than it really needed to. - FIXED: added Tween.set() to the TypeScript definitions. See #392 - FIXED: if overwrite is set to "auto" and the playhead jumps way ahead past the end of an overlapping tween, it may not be overwritten. - FIXED: GSDevTools prevented overwrite: "auto" from functioning properly. Beware, however, that GSDevTools forces the global timeline to the end initially and then starts over so that all animations are initialized, thus overwriting occurs immediately. - FIXED: when you kill() a ScrollTrigger, it will also kill its marker elements now. - FIXED: if you alter the timeScale() of an animation that has a delay before it begins, it would appear to skip the delay. See https://greensock.com/forums/topic/24627-delay-ignored-when-timescale-set/ - FIXED: if a ScrollTrigger's pinned element was display: inline, it would collapse during the pinning. It's now switched to inline-block to maintain sizing. See https://greensock.com/forums/topic/24685-scrolltrigger-trouble-with-pinning/ - FIXED: if markers are enabled and there's one at the very bottom of the screen, viewport resizes may cause the marker to invert and its height would be incorporated into the page height.
1 parent ff8ed36 commit c7e6623

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1198
-560
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ View the <a href="https://greensock.com/docs">full documentation here</a>, inclu
1818

1919
### CDN
2020
```html
21-
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.3.4/gsap.min.js"></script>
21+
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.4.0/gsap.min.js"></script>
2222
```
2323
Click the green "Get GSAP Now" button at <a href="https://greensock.com/?download=GSAP-JS">greensock.com</a> for more options and installation instructions, including CDN URLs for various plugins.
2424

dist/CSSRulePlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}(this, (function (exports) { 'use strict';
66

77
/*!
8-
* CSSRulePlugin 3.3.4
8+
* CSSRulePlugin 3.4.0
99
* https://greensock.com
1010
*
1111
* @license Copyright 2008-2020, GreenSock. All rights reserved.
@@ -51,7 +51,7 @@
5151
};
5252

5353
var CSSRulePlugin = {
54-
version: "3.3.4",
54+
version: "3.4.0",
5555
name: "cssRule",
5656
init: function init(target, value, tween, index, targets) {
5757
if (!_checkRegister() || typeof target.cssText === "undefined") {

dist/CSSRulePlugin.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/CSSRulePlugin.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Draggable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2909,7 +2909,7 @@
29092909
});
29102910

29112911
Draggable.zIndex = 1000;
2912-
Draggable.version = "3.3.4";
2912+
Draggable.version = "3.4.0";
29132913
_getGSAP() && gsap.registerPlugin(Draggable);
29142914

29152915
exports.Draggable = Draggable;

dist/Draggable.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Draggable.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/EasePack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}(this, (function (exports) { 'use strict';
66

77
/*!
8-
* EasePack 3.3.4
8+
* EasePack 3.4.0
99
* https://greensock.com
1010
*
1111
* @license Copyright 2008-2020, GreenSock. All rights reserved.
@@ -201,7 +201,7 @@
201201

202202
for (var p in EasePack) {
203203
EasePack[p].register = _initCore;
204-
EasePack[p].version = "3.3.4";
204+
EasePack[p].version = "3.4.0";
205205
}
206206

207207
_getGSAP() && gsap.registerPlugin(SlowMo);

0 commit comments

Comments
 (0)