Basic sliding tab menu


/ Published in: jQuery
Save to your folder(s)

Get menu tabs to slide up/down when hovering over them.
For some reason, it only starts working after you've hovered above a tab first.
I should find out why that is.


Copy this code and paste it in your HTML
  1. $(document).ready(function() {
  2.  
  3. $('.menu .slide a').hover(function() { //the mouse in part
  4. $(this).animate({ marginTop: '0px' }, 200); //can be replaced by padding or whatever
  5. },
  6.  
  7. function() { //the mouse out part
  8. $(this).animate({ marginTop: '10px' }, 300);
  9. });
  10.  
  11. });

URL: http://medilab.be/index.php

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.