Stairway Hover Nav
How do I make an stairway hover nav?
Now a jQuery plugin.. What is a stairway hover nav? How do you make a stairway hover nav? This script and codes were developed by Chris Coyier on 04 July 2022, Monday.
Stairway Hover Nav - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Stairway Hover Nav</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Stairway Nav</h1>
<div> <h2>One Step</h2> <nav id="example-one"> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> </nav>
</div>
<div> <h2>Two Step</h2> <nav id="example-two"> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> </nav>
</div>
<div> <h2>Three Steps</h2> <nav id="example-three"> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> </nav>
</div>
<div> <h2>Four Steps</h2> <nav id="example-four"> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> <a href="#">Navigation</a> </nav>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Stairway Hover Nav - Script Codes CSS Codes
#example-one { background: #f06d06;
}
#example-one .active-1 { background: #fa9748;
}
#example-two { background: #0dacc4;
}
#example-two .active-1 { background: #40dbf2;
}
#example-two .active-2 { background: #10ceea;
}
#example-three { background: #1acd0d;
}
#example-three .active-1 { background: #41f234;
}
#example-three .active-2 { background: #2bf11c;
}
#example-three .active-3 { background: #1de50f;
}
#example-four { background: #666;
}
#example-four .active-1 { background: #999999;
}
#example-four .active-2 { background: #8c8c8c;
}
#example-four .active-3 { background: gray;
}
#example-four .active-4 { background: #737373;
}
nav { -moz-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
}
nav a { display: block; padding: 10px; color: white; text-decoration: none; position: relative; -moz-transition: all 0.2s ease; -o-transition: all 0.2s ease; -webkit-transition: all 0.2s ease; transition: all 0.2s ease;
}
nav a.active-1 { -moz-transform: scale(1.1) translateX(24px); -ms-transform: scale(1.1) translateX(24px); -webkit-transform: scale(1.1) translateX(24px); transform: scale(1.1) translateX(24px); box-shadow: 0 0 10px rgba(0, 0, 0, 0.75); z-index: 3;
}
nav a.active-2 { -moz-transform: scale(1.07) translateX(12px); -ms-transform: scale(1.07) translateX(12px); -webkit-transform: scale(1.07) translateX(12px); transform: scale(1.07) translateX(12px); box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); z-index: 2;
}
nav a.active-3 { -moz-transform: scale(1.04) translateX(4px); -ms-transform: scale(1.04) translateX(4px); -webkit-transform: scale(1.04) translateX(4px); transform: scale(1.04) translateX(4px); z-index: 1;
}
nav a.active-4 { -moz-transform: scale(1.01) translateX(2px); -ms-transform: scale(1.01) translateX(2px); -webkit-transform: scale(1.01) translateX(2px); transform: scale(1.01) translateX(2px); z-index: 1;
}
body { background: #222; color: white; padding: 20px;
}
body > div { width: 20%; float: left; margin-right: 5%;
}
h1 { font-size: 36px; margin: 0 0 10px 0;
}
h2 { margin: 0 0 10px 0;
}
Stairway Hover Nav - Script Codes JS Codes
$.fn.stairwayNav = function(options) { var defaults = { stairs: 3 }; this.options = $.extend({}, defaults, options); var stairs = this.options.stairs; var allLinks = this.find("a"); allLinks .mouseenter(function() { $(this).addClass("active-1"); var index = $(this).index(), i, bef, aft; for(i = 1; i < stairs; i++) { bef = index - i; aft = index + i; allLinks.eq(aft).addClass("active-" + (i+1)); if (bef > 0) { allLinks.eq(bef).addClass("active-" + (i+1)); } } }) .mouseleave(function() { allLinks.removeClass("active-1 active-2 active-3 active-4"); }); return this;
};
$("#example-one").stairwayNav({ stairs: 1
});
$("#example-two").stairwayNav({ stairs: 2
});
$("#example-three").stairwayNav({ // Default is 3
});
$("#example-four").stairwayNav({ stairs: 4
});
Developer | Chris Coyier |
Username | chriscoyier |
Uploaded | July 04, 2022 |
Rating | 4.5 |
Size | 3,213 Kb |
Views | 131,560 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Make This Responsive | 2,086 Kb |
Airtable Emoji Poll | 3,194 Kb |
Simple jQuery Slideshow | 1,911 Kb |
Three-Line Menu Icon, Various Techniques | 3,015 Kb |
Glowing Blue Inputs | 2,475 Kb |
Transformer Tabs | 5,160 Kb |
Filtered Search RWD Pattern | 3,722 Kb |
Striped Headers | 3,177 Kb |
Vertical-align examples | 1,819 Kb |
A Pen by Chris Coyier | 2,033 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
A Pen by Gregory Potdevin | GregoryPotdevin | 1,713 Kb |
Login-ng-modal | Heedoo | 3,566 Kb |
Bezier Animation with straight paths | Rhernando | 2,087 Kb |
CSS3 Animated buttons | Cguillou | 3,737 Kb |
Mobile first social buttons with no iframe | Alistairtweedie | 3,158 Kb |
Simple Login Form Template | Banunn | 3,571 Kb |
Nice textured background | Hans | 2,659 Kb |
CSS only simple parallax scroll | Stanssongs | 3,708 Kb |
Hover Animation from UNIQLO | Insprd | 3,772 Kb |
Flying Bee | Pwsm50 | 3,711 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!