Added odometer-digit-added event#53
Added odometer-digit-added event#53julen wants to merge 1 commit intoHubSpot:masterfrom julen:added-event
odometer-digit-added event#53Conversation
This is useful for animating the width of the odometer in case the number of digits increases or decreases.
|
Looks great! Only tweak I'd suggest is listening to the |
|
Hmm just checked but the effect is not the same if I listen to In my example the width slowly expands while the new digit is rotating. |
|
I'm not sure I understand why the |
|
You're right, I kept it from the initial implementation I had (without this new event) so not sure why I included it in the JSFiddle in the first place. In any case the event is needed unless the library sets the width after each digit is inserted. |
|
Any chance to have this merged? Ideally I'd like to use the CommonJS module from npm instead of a custom build with this enhancement. |
I needed a way to set the odometer's width in order to smoothly animate it when the number of digits increased/decreased, so I ended up adding an
odometer-digit-addedevent which is triggered every time a digit is inserted to the DOM.You can check the JSFiddle I created in order to showcase the end result (I included the compiled JS result code in the commit only to be able to use it from the JSFiddle as an external resource).
There might probably be a better way to handle this, but I don't know the source code well enough to determine that.