native-slide-toggle | Vanilla JS mobile friendly version of jQuery.slideToggle | Animation library
kandi X-RAY | native-slide-toggle Summary
kandi X-RAY | native-slide-toggle Summary
slide toggle to open or close content using CSS transition and transitionend event.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Toggle the class on the content
- expand the content
- Collapse the contents of a component
- Initializes all registered sub - hooks .
- Toggle the content end
- Initializes the component
- Destroys a component
- Finds the first slide of a given element .
- Destroys all registered options
- Toggle onClick listener
native-slide-toggle Key Features
native-slide-toggle Examples and Code Snippets
Community Discussions
Trending Discussions on native-slide-toggle
QUESTION
I'm implementing the a slide toggle for a nested menu in AngularJS. I've been using the code from the following page: https://blog.assaf.co/native-slide-toggle-for-angularjs-1-4-x/
I'm having only one problem with it though. I'm trying to implement this on a sidenav menu with nested submenues, built with
- and
elements. After having toggled a menu item that has submenu, and I later toggle the submenu of that same menu button, the
element of that menu button doesn't slide in. The height remains the same.
Also, if I keep the submenu closed, and open only the top menu item, the height of the
- element remains the same when I toggle the submenu, meaning that the submenu doesn't show until I toggle it open (though remaining invisible), then close the top menu button, then open it again.
Please see it in action here: https://codepen.io/marcus-edensky/pen/MBoWZJ
Here's my JavaScript code:
...
ANSWER
Answered 2018-Jul-27 at 03:12The parent still holds the height after the animation. You have to remove it.
Add element[0].style.height = 'auto'
after animation is done.In the generateRunner
function at line 36 after the if
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install native-slide-toggle
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page