How to use recursion techniques in off canvas navigations
I'm trying to create an off canvas navigation. This article provides some good techniques: http://tympanus.net/codrops/2013/08/...comment-460738
I'm trying to understand the recursion techniques in the sidebarEffects.js file in above article: https://github.com/codrops/SidebarTr...ebarEffects.js
The function hasParentClass (line 13) and bodyClickFn (line 38) all use recursion techniques.
I understand hasParentClass (line 13) uses recursion to repeatedly look for any element has parent "st-menu" (line 38) - please correct me if I'm wrong.
But for bodyClickFn (line 38), this function already has "resetMenu();" to hide the menu. I'm not quite sure why do we need this line "document.removeEventListener( eventtype, bodyClickFn );".
Any explanation is helpful. Many thanks!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)