brentoncozby / dom-slider Goto Github PK
View Code? Open in Web Editor NEWPlain JavaScript version of jQuery's slideToggle(), slideDown(), & slideUp(), but does not use display: none.
License: MIT License
Plain JavaScript version of jQuery's slideToggle(), slideDown(), & slideUp(), but does not use display: none.
License: MIT License
If ill use slideDown, and after inside element change height (like add some items in spoiler), after slideUp and slideDOwn will bug, because start animation from old height.
Why not just export the functions, like a normal library? Extending Object prototype is way too invasive, and especially in the way it is done here, it will affect every single for (let x in y)
loop in the entire script, causing them to iterate over your functions.
I was looking for something like this (thanks for writing it), but it doesn't look like it works if the element to be toggled is hidden by default using display: none
For instance, if this were to be used for a FAQ toggler, the answers wouldn't be revealed when the questions were clicked.
padding-top and padding-bottom is wrongly calculated when element is closed by default with display: none or DOM-slider-hidden
on the first opening the padding-top and padding-bottom is always 0px
Hi, I discovered bug, that slideUp is not working properly.
Firefox version: 74.0.1 (64-bit)
Hi, I created a little script which uses "dom-slider" and working well "alone", but when I put on production website where there are many other scripts, including jQuery, I got this error:
Cannot redefine property: slideDown
.
I research quickly and saw something related with "slideDown" (re)declaration (source).
I don't know it's a problem on my side, and there is a way to avoid this conflict, like the "dom-slider" method should work only my application scope.
Or if you could fix it following the idea on define configurable: true
but we need to think on the "side-effects" from this change.
Let me know you think about this, please.
Thanks in advance
PS: there is a question and some comments, maybe could help us :)
This would be better than e.g. setTimeout
:
https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
Hello! ๐
We're using dom-slider
in @sparkdesignsystem and we're running into an accessibility issue. Because dom-slider
does not use display: none
when hiding the content, the content is still available to screen readers when it should be hidden. This is only the case after the contents are hidden by dom-slider
; you may need to expand and then collapse a component to see this issue in action.
Hey @BrentonCozby, when I load this plugin alongside with CSSPlugin from GSAP it throws a 'classList' of undefined
error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.