鼠标悬浮

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
 <meta>


<%--<script type="text/javascript">
    (function($) {
        $.fn.floatAutoScroll = function() {
            this.each(function() {
                var obj = $(this);
                var top = obj.css('top').replace('px', '');
                $(window).scroll(function() {
                    var scrollTop = $(window).scrollTop();
                    obj.stop().animate({ top: (top * 1 + scrollTop * 1) }, 'normal');
                });
            });
        }
    })(jQuery);
    $(function() {
        $('.float-container').floatAutoScroll();
    });
</script>
<style type="text/css">
.float-container { position:absolute; width:50px; height:50px;}
.float1 { top:360px; }
</style>--%>








<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
 
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
	<style type="text/css">
 
		.abs{ position: absolute;  right: 10px; border: solid 1px black;  width: 100px; height: 50px; top: 300px}
	</style>
</head>
<body>
 
	<div>
		<script type="text/javascript">
		    for (var i = 0; i < 1000; i++) {
		        document.write(i + "<br/>");
		    }
 
 
		</script>
 
	</div>
 
	<div class="abs">
 
	</div>
	<script type="text/javascript">

	    window.onscroll = function () {
	        // if (document.documentElement && document.documentElement.scrollTop) {
	        var top = document.documentElement.scrollTop || document.body.scrollTop;
	        top += 300;
	        $(".abs").stop(true, false).animate({ top: top + "px" }, 1000);


	    };
 
 		
	</script>
</body>
</html>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值