Advertisement
afsarwebdev

On scroll line draw and addClass selected sections

Oct 23rd, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. //on scroll line draw and specific section addClass
  2. //JS
  3. $j(window).scroll(function(){
  4. var scrolltop = $j(window).scrollTop();
  5. if(scrolltop > 50){
  6. $j('.line').height(scrolltop+110);
  7. }else{
  8. $j('.line').height(scrolltop-110);
  9. }
  10. if(isInViewport('#services') || isInViewport('#casestudies')){
  11. $j('.line').addClass('white')
  12. }else{
  13. $j('.line').removeClass('white')
  14. }
  15. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement