How does this jquery loop works? -


i ask how loop works ?

i've read docs .data() method can't figure out happening in example. @ begging set 'size' , big parameters this?

if ($(window).width() >= 1025) {     $(function(){     $('.navbar').data('size', 'big');      $(window).scroll(function(){       if ($(document).scrolltop() > 0) {         if ($('.navbar').data('size') == 'big') {           $('.navbar').data('size', 'small');           $('.navbar').stop().animate({             height: '5vh'           }, 600);         }       } else {         if ($('.navbar').data('size') == 'small') {           $('.navbar').data('size', 'big');           $('.navbar').stop().animate({             height: '15vh'           }, 600);         }         }     }); 

there no loop, data storing parameter "size". (can 'big' or 'small').

the value changing when scrolling. height of navbar updated.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -