不同方式实现类似校内人人底部固定
- 作者: 狗族长老
- 来源: 51数据库
- 2022-09-21
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.51sjk.com/Upload/Articles/1/0/330/330369_20220921173857689.jpg"> <HEAD> <TITLE>jquery博客实现底部固定类似人人校内似的</TITLE> <meta name="keywords" content="底部固定,人人校内" > <meta name="description" content="jQuery吧,Write Less, Do More,注重前端开发,web前端开发"> <META http-equiv=Content-Type content="text/html; charset=GBK"> <STYLE type=text/css> *{margin:0;padding:0} .fixed {RIGHT: 15px; BACKGROUND: #ccc; LEFT: 15px; BOTTOM: 0; LINE-HEIGHT: 30px; POSITION: fixed; HEIGHT: 30px } #iefixed { MARGIN: -1px 15px 0px; OVERFLOW: hidden; ZOOM: 1; HEIGHT: 1px } </STYLE> <!--[if lt IE 7]> <script type="text/javascript"> function _fixBackground(){ var body = document.body; var BLANK_GIF; if (body.currentStyle.backgroundAttachment != "fixed") { if (body.currentStyle.backgroundImage == "none") { body.runtimeStyle.backgroundImage = "url("+BLANK_GIF+")"; // dummy body.runtimeStyle.backgroundAttachment = "fixed"; } } } window.onload = function(){ _fixBackground(); } </script> <style type="text/css"> .fixed{ position: absolute; bottom: auto; clear: both; width:expression(document.getElementById('iefixed').clientWidth); left:expression(document.getElementById('iefixed').offsetLeft); top:expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollTop +(documentElement.clientHeight-this.clientHeight) : document.body.scrollTop +(document.body.clientHeight-this.clientHeight)); } </style> <![endif]--> </HEAD> <BODY> <div ><script type="text/javascript">/*DEMO728*90,创建于2012-5-15*/ var cpro_id = 'u897038';</script><script src="http://www.51sjk.com/Upload/Articles/1/0/330/330369_20220921173859064.js" type="text/javascript"></script></div> <div ><script type="text/javascript">/*468*60,创建于2012-5-7*/ var cpro_id = 'u883919';</script><script src="http://www.51sjk.com/Upload/Articles/1/0/330/330369_20220921173859064.js" type="text/javascript"></script></div> <h1><a href="http://www.jqueryba.com/" target="_blank" title="jquery,jquery博客,jquery效果,前端开发,web前端,web前端开发,设计,前端资源,html+CSS,JavaScript,html5,css3,浏览器兼容">jQuery吧</a></h1> <h2><a href="http://www.jqueryba.com/396.html" target="_blank">jquery博客实现底部固定类似人人校内似的</a></h2> <!--[if lt IE 7]><div id="iefixed"></div><![endif]--> <div ></div> <DIV class=fixed>这里是position:fixed部分.我又不动啦</DIV> <div ></div> <script type="text/javascript">/*DEOM120*270,创建于2012-5-12*/ var cpro_id = 'u893319';</script><script src="http://www.51sjk.com/Upload/Articles/1/0/330/330369_20220921173859267.js" type="text/javascript"></script> <script type="text/javascript">/*DEMO728*15,创建于2012-5-15*/ var cpro_id = 'u897027';</script><script src="http://www.51sjk.com/Upload/Articles/1/0/330/330369_20220921173859064.js" type="text/javascript"></script> </BODY> </HTML>
推荐阅读