Giter Site home page Giter Site logo

brentoncozby / dom-slider Goto Github PK

View Code? Open in Web Editor NEW
61.0 61.0 7.0 198 KB

Plain JavaScript version of jQuery's slideToggle(), slideDown(), & slideUp(), but does not use display: none.

License: MIT License

JavaScript 66.23% HTML 27.04% CSS 6.73%
accessibility animation jquery vanilla-js

dom-slider's People

Contributors

brentoncozby avatar dependabot[bot] avatar eenewbsauce avatar julkue avatar rcopeland avatar tunui avatar yodasw16 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dom-slider's Issues

How to reinit height?

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.

Do not extend Object prototype

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.

Doesn't work if element is hidden by default via CSS

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.

Cannot redefine property: slideDown

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 :)

Collapsed content is still visible to screen readers

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.

Steps to Reproduce using VoiceOver on macOS

  1. Open example.html in a browser
  2. Turn on VoiceOver (Cmd+F5, by default)
  3. Refresh example.html to put VoiceOver focus in the page.
  4. Use the VoiceOver navigation (Ctrl+Option+Arrows, by default) to scroll around the page. Note that the collapsed contents are not read by the screen reader.
  5. Expand and Collapse a toggle using the VoiceOver trigger (Ctrl+Option+Space, by default)
  6. Scroll around with VO navigation again and observe that the contents are still visible to screen readers even when hidden.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.