GochiSiyan

order change

Feb 10th, 2021 (edited)
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. (function(){
  2. list = document.querySelectorAll('ul.jeg_accountlink')
  3. list.forEach(function(value_parent,index_parent){
  4. value_parent.addEventListener('mouseover',function(){
  5. if (! this.classList.contains('init')) {
  6. this.classList.add('init')
  7. elem = this.querySelector('ul')
  8. elem.style.display='flex'
  9. elem.style.flexDirection='column'
  10. Array.from(elem.children).forEach(function(value,index){
  11. switch(value.querySelector('a').classList[0]){
  12. case 'account':
  13. value.style.order=2
  14. break
  15. case 'my_channel':
  16. value.style.order=1
  17. break
  18. case 'order':
  19. value.style.order=4
  20. break
  21. case 'custom_menu_1':
  22. value.style.order=3
  23. break
  24. case 'logout':
  25. value.style.order=5
  26. break
  27. }
  28. })
  29. }
  30. })
  31. })
  32. })()
Add Comment
Please, Sign In to add comment