<style type="text/css">
#float{width:100px; height:200px; position:absolute;}
</style>
<script type="text/javascript">
var rollWidgets = function() {
this.html = "";
this.id = null;
this.posi = function(id) {
setTimeout(function() {
$("#" + id).css({
"top": $.browser.scroll().top + $.browser.client().height - 350 + "px",
"left": screen.width/2-500+ 980+ "px"
}).show();
},
200);
};
this.rool = function() {
var _this = this;
_this.posi(_this.id);
$(window).bind("resize",
function() {
_this.posi(_this.id);
}).bind("scroll",
function() {
_this.posi(_this.id);
})
};
}
var newRoll = new rollWidgets();
newRoll.id = "float";
newRoll.rool();
</script>
转载于:https://www.cnblogs.com/lovening/archive/2011/09/28/2194221.html