From the course: Creating a Responsive Web Design: Advanced Techniques
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Removing the style attribute from the nav element - CSS Tutorial
From the course: Creating a Responsive Web Design: Advanced Techniques
Removing the style attribute from the nav element
- Now, the last thing we need to do to complete our collapsible menu is to remove the style attribute that's being applied to the navigation element. So, let's go back to our JavaScript file, we're going to use something called a callback function on the 'animate' function here that's running inside of the 'else' portion of the conditional statement, and we do that by coming in here after the duration, which is 750 milliseconds, still inside of the parentheses for animate, let's hit a comma, and we'll type in 'function', another set of parenthesis, another set of curly brackets, let's come in here and split this open, so, this callback function here will only run after the animation is complete. So, once the animation's complete, we want to come in here and remove the style attribute from the nav element. Now, since this item already searched for the nav element and is running the animation, we can come in here and instead use a shortcut in jQuery called 'this'. So, we'll type a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
About this lesson46s
-
(Locked)
Relocating the nav element4m 33s
-
(Locked)
Adding a mobile link button4m 43s
-
(Locked)
Removing the header height restrictions2m 2s
-
Restyling the mobile menu2m 22s
-
(Locked)
Adjusting the logo to overlap the menu3m 58s
-
(Locked)
Adding JavaScript and jQuery to your project5m 32s
-
(Locked)
Attaching a click event to the mobile menu button4m 4s
-
(Locked)
Animating the height of the navigation4m 51s
-
(Locked)
Removing the style attribute from the nav element5m 21s
-
(Locked)
Where to go from here25s
-
(Locked)
-
-