Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. for (var i = 0; i < window.dropdowns.length; i++) {
  2. var e = window.dropdowns[i];
  3. if ($(event.target).closest('.active').length == 0) {
  4. e.hideList();
  5. }
  6. }
  7.  
  8. for (var i = 0; i < window.dropdowns.length; i++) {
  9. var e = window.dropdowns[i];
  10. var parent = event.target.parentElement;
  11. while (parent.tagName != 'BODY') {
  12. if (parent.className.indexOf('active') > 0) {
  13. e.hideList();
  14. break;
  15. }
  16.  
  17. parent = parent.parentElement;
  18. }
  19. }
  20.  
  21. //First while loop
  22. console.time(firstWhileLoopInFunction)
  23. console.timeEnd(firstWhileLoopInFunction)
  24.  
  25. //Second while loop
  26. console.time(secondWhileLoopInFunction)
  27. console.timeEnd(secondWhileLoopInFunction)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement