<style>
.scroll_box{POSITION:relative;WIDTH:100%;FLOAT:left}
</style>
<div class="scroll_box">
<div class="content_right_scroll">
ddddddddddddd
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
//按钮跟随
$(window).scroll(function(){
$('.content_right_scroll').Jscroll(30);
});
});
//跟随屏幕
$.fn.Jscroll = function(Mt){
var T = $(this);
var box_t = T.parent().offset().top - 45;
var W_t = $(window).scrollTop();
var box_h = T.parent().height();
if(W_t >= box_t - Mt)
{
T.css({'position':'absolute','top':W_t-box_t+Mt+'px'});
}
else if(W_t <= box_t)
{
T.css({'top':'0px'});
}
else
{}
};
</script>