当你滚动时,我试图让文本跟随屏幕,
我已将所有文本放在名为“mydiv”的 div 中
<div id="mydiv" >
<!-- lots of stuff in asp -->
<table>
<!-- table rows, etc. -->
</table>
</div>
jQuery
<script type="text/javascript"src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var currentTop = parseInt($('#mydiv').css('top'));
$(window).scroll(function () {
var top = $(window).scrollTop();
$('#mydiv').css('top', top+currentTop);
});
});
</script>
这是我的CSS
.mydiv{
position:absolute;
top:10px;
}