jquery scroll down with change letter spacing
i want to animate text with scroll down.
i apply this code.this is working. but
scrolled<400 not stop.code is running.how to fixed this issue,
Thank You .....
-
$(function(){
$(window).scroll(function() {
var scrolled=-($(window).scrollTop())/50;
$('#scrolled').text('scrolled: '+scrolled+'px');
if(scrolled<400){ $('#cName').css({'letter-spacing':12+scrolled+'px'}); }
else{$('#cName').css({'color':'red'});}
});
});