jquery - FadeIn and FadeOut when page scroll -
i create div, put social link. want when user scroll page more > 100, div fade in, , when user come < 100, fadeout. how can it?
<style type="text/css"> #social-icons-wrapper { /* custom properties */ padding:10px; text-align:center; font-size:20px; background: #000; color:#fff; width:100%; height:32px; /* required properties */ display:none; position: fixed; top: 0; z-index: 999999; } </style> <div id="social-icons-wrapper"><!-- social icons here --></div> <script type="text/javascript"> //<![cdata[ $(function () { $(window).scroll(function () { if ($(this).scrolltop() > 100) { $('#social-icons-wrapper').stop().fadein(200); } else { $('#social-icons-wrapper').stop().fadeout(200); } }); }); //]]> </script>
Comments
Post a Comment