想法:在列表中勾选部分 ITEM然后可以通过按钮批量操作,但是ITEM过多需要滚动时候 ,一个浮动在浏览器最下方的BAR就很实用了。
方法:CSS的position和bottom属性来控制 DIV的位置即可
实测:position:fixed 不实用,所以还是要通过JS来实现。注意的是position:absolute。
代码:
<script type="text/javascript">
function sc(){
document.getElementById('pager').style.top=(document.documentElement.scrollTop+(document.documentElement.clientHeight- document.getElementById('pager').offsetHeight))+"px";
document.getElementById('pager').style.width=document.documentElement.clientWidth - 220+"px";
}
window.οnscrοll=function(){sc()};
window.οnresize=function(){sc()};
window.οnlοad=function(){sc()};
</script>
总结:关于最后的window.οnscrοll=function(){sc()}; 最开始直接写了window.οnscrοll=sc(); 但是会报错,报错信息“尚未实现”。找了网上资料,别人说这样写,具体原因未知。