By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
LahbabiGuideLahbabiGuide
  • الرئيسية
  • مزيج مِن أفكاري
    • مقالاتي
    • قصص قصيرة
    • سيناريوهات أفلام قصيرة
    • نصوص مسرحية قصيرة
  • أفكار المشاريع
  • قصص النجاح
  • أخبار تقنية
  • القرأن الكريم
Search
  • Advertise
© 2022 Zakariaelahbabi.com . Company. All Rights Reserved.
Reading: Stairway Hover Navigation Using CSS and jQuery | Stairy Type Hover
Share
Notification Show More
Latest News
bootstrap-clean-buttons-with-hover-effect-|-plain-button-ui-kit
Bootstrap Clean Buttons With Hover Effect | Plain Button UI Kit
Bootstrap
bootstrap-datatable-with-sort,-pagination,-and-search-|-sorting-data-table
Bootstrap Datatable With Sort, Pagination, and Search | Sorting Data Table
Bootstrap
upload-image-in-php-with-mysql-database-|-web-dev-trick
Upload Image In PHP With MySQL Database | Web Dev Trick
PHP
bootstrap-tooltip-progress-bar-animation-|-percentage-values-in-tooltip
Bootstrap Tooltip Progress Bar Animation | Percentage Values in Tooltip
Bootstrap
php-age-calculator-program-|-calculate-age-in-php
PHP Age Calculator Program | Calculate Age In PHP
PHP
Aa
LahbabiGuideLahbabiGuide
Aa
  • مزيج مِن أفكاري
  • أخبار تقنية
  • تطوير الويب
  • أفكار المشاريع
Search
  • Home
    • Home 1
    • Default Home 2
    • Default Home 3
    • Default Home 4
    • Default Home 5
  • Categories
    • تطوير الويب
    • أخبار تقنية
    • أفكار المشاريع
    • مزيج مِن أفكاري
    • قصص النجاح
  • Bookmarks
  • More Foxiz
    • Sitemap
Follow US
  • Advertise
© 2022 Foxiz News Network. Ruby Design Company. All Rights Reserved.
stairway-hover-navigation-using-css-and-jquery-|-stairy-type-hover
LahbabiGuide > تطوير الويب > CSS > Stairway Hover Navigation Using CSS and jQuery | Stairy Type Hover
CSS

Stairway Hover Navigation Using CSS and jQuery | Stairy Type Hover

admin
Last updated: 2023/03/11 at 7:35 صباحًا
By admin
Share
15 Min Read
SHARE

How we can create a stair type hover animation using CSS and JS? Solution: See this Stairway Hover Navigation Using CSS and jQuery, Stairy Type Hover Effect.

Contents
Preview Of Stairy Type Hover Effect For NavStairway NavOne StepTwo StepThree StepsFour Steps

Previously I have shared many hover effects and navigation programs, it is a stair type effect on hover. Basically, a navigation hover effect shows an animation effect when we hover on a nav item. It makes the item pretty and different from others to visualize it active or special. And there the stairway type effect takes the active and more items to make a stair type effect.

Today you will learn to create Stair Type Hover Effect for nav items. Basically, there are 4 navigation sections and each section has a little different effect. The first section has 1 step effect, the second sections have 2 step effect, the third has 3 step effect, and the fourth has 4 step effect. Means more steps effect combine upper and lower items and create an effect similar to a stair. And when you will hover up to down or down to up then you will feel stair goes up and down.

So, today I am sharing Stairway Hover Navigation Using CSS and jQuery. There I have used CSS to create the animations and jQuery for dynamic function for change hover position effect. There I have used jQuery to save time and fewer codes, and it is a JS library. You can use this program for navigation or side menu options on the website.

If you are thinking now how this navigation hover effect actually is, then see the preview given below.

Preview Of Stairy Type Hover Effect For Nav

See this video preview to getting an idea of how this nav hover effect looks like.

https://webdevtrick.com/wp-content/uploads/stair-type-nav.mp4

Live Demo

Now you can see this program visually, also you can see it live by pressing the button given above. If you like this then get the source code of its.

You May Also Like:

  • Minimal To Do App
  • Multi Level Accordion Menu
  • Flex Hover Slider
  • 3D Visualization Elements

Before sharing source code, let’s talk about it. First I have created a div and placed a heading tag, and nav tag with 10 nav items inside it. And I have placed the same elements 4 times with different ID names. Because there I created 4 navigations, that’s why I have copied and pasted elements 4 times. Also in the HTML file, I have linked external files like CSS, JS, and jQuery CDN.

Now using CSS I have placed all the items in the right place, as you can see in the preview. With CSS first I gave basic values like size, position, margin, padding, etc to the elements. After that, I gave color values light and dark color combination to visualize the stair better. Also There I have used CSS transform command to scale and change the position of elements.

JavaScript handling here the change active items on hover position change. And also I have declared the stair block values, which mean how many blocks will active on different nav sections. I have used for {} loop command and added and removed class names according to action. Left all other things you will understand after getting the codes, I can’t explain all in writing.

For creating this program you have to create 3 files. First file for HTML, second for CSS, and the third file for JavaScript. Follow the steps to creating this program without any error.

index.html

Create an HTML file named ‘index.html‘ and put these codes given here.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

lang=“en” >

  charset=“UTF-8”>

  </span><span>Stairway Hover Nav | Webdevtrick.com</span><span>

  rel=“stylesheet” href=“https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css”>

rel=“stylesheet” href=“./style.css”>

Stairway Nav

  

One Step

  

id=“example-one”>

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

  

  

  

Two Step

  

id=“example-two”>

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

  

  

Three Steps

  

id=“example-three”>

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

  

  

Four Steps

  

id=“example-four”>

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

    href=“#”>Nav

  

style.css

Now create a CSS file named ‘style.css‘ and put these codes given here.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

/* Code By Webdevtrick ( https://webdevtrick.com ) */

body {

  background: #eeeeee;

  color: #212121;

  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;

}

#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;

}

function.js

The final step, create a JavaScript file named ‘function.js‘ and put the codes.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

// Code By Webdevtrick ( https://webdevtrick.com )

$.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({

});

$(“#example-four”).stairwayNav({

  stairs: 4  

});

That’s It. Now you have successfully created Stairway Hover Navigation Using CSS and jQuery, Stairy Type Hover Effect. If you have any doubt or questions comment down below.

Thanks For Visiting, Keep Visiting.

You Might Also Like

Bootstrap Clean Buttons With Hover Effect | Plain Button UI Kit

Bootstrap Datatable With Sort, Pagination, and Search | Sorting Data Table

PHP Age Calculator Program | Calculate Age In PHP

Bootstrap Tooltip Progress Bar Animation | Percentage Values in Tooltip

Generate Random Numbers In PHP | Numbers In Sort By Order

TAGGED: CSS, css hover effect, hover, HTML, JavaScript, jquery, nav, navigation, source code, stair type, stairway
admin مارس 11, 2023
Share this Article
Facebook Twitter Pinterest Whatsapp Whatsapp LinkedIn Tumblr Reddit VKontakte Telegram Email Copy Link Print
Previous Article image-comparison-slide-using-jquery-and-css-|-image-compare-slider Image Comparison Slide Using jQuery and CSS | Image Compare Slider
Next Article neumorphism-login/register-form-design-|-switch-between-forms Neumorphism Login/Register Form Design | Switch Between Forms
Leave a comment Leave a comment

اترك تعليقاً إلغاء الرد

لن يتم نشر عنوان بريدك الإلكتروني. الحقول الإلزامية مشار إليها بـ *

Stay Connected

235.3k Followers Like
69.1k Followers Follow
11.6k Followers Pin
56.4k Followers Follow
136k Subscribers Subscribe
4.4k Followers Follow
- Advertisement -
Ad imageAd image

Latest News

bootstrap-clean-buttons-with-hover-effect-|-plain-button-ui-kit
Bootstrap Clean Buttons With Hover Effect | Plain Button UI Kit
Bootstrap مارس 11, 2023
bootstrap-datatable-with-sort,-pagination,-and-search-|-sorting-data-table
Bootstrap Datatable With Sort, Pagination, and Search | Sorting Data Table
Bootstrap مارس 11, 2023
upload-image-in-php-with-mysql-database-|-web-dev-trick
Upload Image In PHP With MySQL Database | Web Dev Trick
PHP مارس 11, 2023
bootstrap-tooltip-progress-bar-animation-|-percentage-values-in-tooltip
Bootstrap Tooltip Progress Bar Animation | Percentage Values in Tooltip
Bootstrap مارس 11, 2023
//

We influence 20 million users and is the number one business and technology news network on the planet

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

[mc4wp_form id=”847″]

LahbabiGuideLahbabiGuide
Follow US

© 2022 Foxiz News Network. Ruby Design Company. All Rights Reserved.

Join Us!

Subscribe to our newsletter and never miss our latest news, podcasts etc..

[mc4wp_form]
Zero spam, Unsubscribe at any time.

Removed from reading list

Undo
Welcome Back!

Sign in to your account

Lost your password?