jQuery(window).scroll(function(){ var $sections = $('section'); $sections.each(function(i,el){ var top = $(el).offset().top-300; }) }); Translate 4 line to native js please.
jQuery(window).scroll(function(){ var $sections = $('section'); $sections.each(function(i,el){ var top = $(el).offset().top-300; }) }); Translate 4 line to native js please.
Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
Source: https://ru.stackoverflow.com/questions/903984/
All Articles