Get item on beforeChange and afterChange events
See original GitHub issueHow can I get the item from the slide if either the beforeChange
or afterChange
event is fired?
So rather than:
pswp.listen('afterChange', function() { });
It be:
pswp.listen('afterChange', function($item) { });
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Getting value of select (dropdown) before change
I am using 1.3.2 version of jQuery and using on change event but the value I am getting over there is after change....
Read more >MaskProperties.AfterChange Event | WinForms Controls
Occurs after a setting of the current MaskProperties object has been changed. Namespace: DevExpress.XtraEditors.Mask. Assembly: DevExpress.
Read more >HTMLElement: change event - Web APIs | MDN
The change event is fired for , , and elements when the user modifies the element's value. Unlike the input event, the change...
Read more >Validation beforeChange AfterChange avoid indefinite loops
I'm designing a table and I'm stuck with the design functionality regarding the Validation, before change and after change events to avoid the...
Read more >listening-proxy - npm
A Javascript deep proxy that can have listeners added (an event listener ... beforeChange and afterChange events; getProperty events - allow ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
pswp.currItem
Note :
beforeChange
gives you the indexDifference as first parameter.So if you just opened the gallery, it will be
null
. If you went from 0 -> 1, it will be 1. You can get the previous index with :