Home  >  Article  >  Web Front-end  >  随窗口浮动qq层 适应屏幕分辨率_html/css_WEB-ITnose

随窗口浮动qq层 适应屏幕分辨率_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:30:391023browse

/* 随窗口浮动层 */.service{position:absolute; width:100%; height:150px;}.service .div{position:relative; width:770px; margin:0 auto; height:172px;}.service .ser{position:absolute; padding:2px; width:92px; height:177px; border:2px solid #1A4E88; background:#fff; left:784px; top:133px;}.service .wel{width:92px; height:23px; background:#1F5FA5; color:#fff; text-align:center; line-height:23px; font-size:11px;}.service .qq{width:76px; height:88px; border:2px solid #eee; margin-top:2px; padding:6px;}


我想适应屏幕分辨率  
1024*768宽的 浮动层被挤进主体页面
超过1024*768宽的 浮动层在主体页面外侧
可以通过修改css代码来实现吗?


回复讨论(解决方案)

<SCRIPT LANGUAGE="JavaScript"> function sc01(){ document.getElementById("Service").style.top=(document.documentElement.scrollTop)+"px"; document.getElementById("Service").style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth-document.getElementById("Service").offsetWidth)+"px";}</SCRIPT><SCRIPT LANGUAGE="JavaScript"> <!--function scall(){ sc01();}window.onscroll=scall;window.onresize=scall;window.onload=scall;//--></SCRIPT>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn