Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2015
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. /* add in html to each nav-item or menu-item that you want the effect */
  2.  
  3. class="flash-underline"
  4.  
  5. /* put in javascript */
  6.  
  7. $(".flash-underline").append("<div class='flash-underline-indicator flash-underline-indicator-inactive'></div>");
  8. $(".flash-underline").hover(
  9. function(event) {
  10. $(this).children(".flash-underline-indicator")
  11. .removeClass("flash-underline-indicator-inactive")
  12. .addClass("flash-underline-indicator-active");
  13. },
  14. function(event) {
  15. $(this).children(".flash-underline-indicator")
  16. .removeClass("flash-underline-indicator-active")
  17. .addClass("flash-underline-indicator-inactive");
  18. }
  19. );
  20.  
  21. /* put in main.css */
  22.  
  23. .flash-underline-indicator {
  24. height: 2px;
  25. margin: auto;
  26. transition: width 0.5s, background 0.5s;
  27. }
  28. .flash-underline-indicator-inactive {
  29. width: 0;
  30. }
  31. .flash-underline-indicator-active {
  32. width: 100%;
  33. background: black;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement