document.write(""); document.write("
"); jQuery(document).ready(function() { var box = $("#floatbox"); var offsetTop = box.offset().top; function autoScroll() { offset = $(document).scrollTop() + offsetTop; box.stop().animate({ top: offset }, 1000); } $(window).scroll(autoScroll); $('.close').click(function() { var width = $('.content-box').width(); if (width == 0) { $('.content-box').animate({ width: 120 }, 500); } else { $('.content-box').animate({ width: 0 }, 500); } }); })