尚纳游戏
您的当前位置:首页基于jquery的DIV随滚动条滚动而滚动的代码_jquery

基于jquery的DIV随滚动条滚动而滚动的代码_jquery

来源:尚纳游戏


核心代码:
代码如下:


$(function() {
$(window).scroll(function() {
var top = $(window).scrollTop()+200;
var left= $(window).scrollLeft()+320;
$("#editInfo").css({ left:left + "px", top: top + "px" });
});
});


用户名:
密码:
年龄:
备注:




在线演示 http://demo.jb51.net/js/2012/jquery_demo/jquery_div.html
记得以前写这样的代码比较麻烦,现在有了JQuery简单多了,就几行代码搞定!

显示全文