<script type="text/javascript">
(function($){
var ele_fix = $("#div_right"); //浮動窗口
var _main = $("
var ele_offset_top = ele_fix
$(window)
var scro_top = $(this)
var fix_foot_pos = parseInt(ele_fix
var mainpos = parseInt(_main
if(scro_top <= ele_offset_top&&fix_foot_pos<mainpos){
ele_fix
}else if(scro_top>ele_offset_top&&fix_foot_pos<mainpos){
ele_fix
}else if(scro_top>ele_offset_top&&fix_foot_pos>mainpos){
var posi = mainpos
ele_fix
}
});
/*
//方案二
$(window)
var temp =
//判斷往下滾
if ($(document)
flag = false;
$(
}
if ($(document)
flag = true;
$(
}
});
*/
})(jQuery);
</script>
From:http://tw.wingwit.com/Article/program/Java/Javascript/201311/25362.html