A
A
Alex ALex2019-01-16 17:31:17
code review
Alex ALex, 2019-01-16 17:31:17

I correctly laid out a fixed menu and in general the weight of the project?

1 Help how to remove the vertical scroll?
2 I couldn't use this code for my project(

var $navFix = $(".meny"); 
 			$(window).scroll(function(){
          if ( $(this).scrollTop() > 120){ // 120 это высота прокрутки
     			 $navFix.addClass("fixed");
    			} else if($(this).scrollTop() <= 120) {
    			 $navFix.removeClass("fixed");
    }
  });

Here is my project.
https://codepen.io/P-RO-ME-TEY/pen/Kboorj

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Goryachev, 2019-01-16
@webirus

There is nothing to evaluate there, since there is nothing stupidly there.
As for the menu, it's not at all clear why JS was needed there.
If the menu is ALWAYS fixed at the top?
The usual one position: fixed;is enough without any JS.
This is a comment on a previous question.
"Gags" when scrolling through sections just kill.
Instead of inventing a bicycle, it was easier to use a ready-madefullPage.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question