Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function() {
- $(function() {
- var $magicLine = $("<div id='magic-line'></div>");
- $(".mainNav").append($magicLine);
- $magicLine
- .width($(".current-menu-item").width())
- .css("left", $(".current-menu-item a").position().left)
- .data("origLeft", $magicLine.position().left)
- .data("origWidth", $magicLine.width());
- $(".mainNav li a").hover(function() {
- $el = $(this);
- leftPos = $el.parent().position().left;
- newWidth = $el.parent().width();
- $magicLine.stop().animate({ left: leftPos, width: newWidth });
- }, function() {
- $magicLine.stop().animate({
- left: $magicLine.data("origLeft"),
- width: $magicLine.data("origWidth")
- });
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement