Advertisement
francescodisalvo

Untitled

Jun 11th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. <script>
  2. var name = "#citybox";
  3. var menuYloc = null;
  4. $(document).ready(function(){
  5. menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
  6. $(window).scroll(function () {
  7. offset = menuYloc+$(document).scrollTop()+"px";
  8. $(name).animate({top:offset},{duration:1000,queue:false});
  9. });
  10. });
  11. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement