Jon*_*s B 1 html javascript css
此脚本显示和定位div,
如:
function myfunction()
{
obj.style.visibility = "visible";
obj.style.width: "100%";
obj.style.height = "100%";
obj.style.position = "absolute";
obj.style.top: "0px";
obj.style.left: "0px";
obj.style.z-index = "44";
obj.focus()
}
Run Code Online (Sandbox Code Playgroud)
等等
<b onclick="myfunction()">Click here</b>
当然它不止于此,但这是为了向您展示我正在尝试做的事情.这很好用,div就像它应该填充屏幕.
问题是,有时我们会显示很多链接,因此用户必须滚动..当div显示它始终位于页面顶部时,用户在获得焦点时会向上滚动.当用户完成并关闭div时,他必须找到回到他所在列表的路.
有没有办法将div相对于浏览器滚动位置定位?
只要你有
position: fixed;
Run Code Online (Sandbox Code Playgroud)
会没事的......
或者我在这里遗失了什么?
例如,看看UserVoice在几个站点中宣布图像,比如tr.im(现已不存在)
它有我认为你想要完成的行为,我是对的吗?
替代文字http://www.balexandre.com/temp/2009-09-23_1449.png
你可以从FireBug中获取的CSS是:
a#uservoice-feedback-tab {
background:#A5C1D1 url(http://feedback.tr.im/images/feedback_tab_black.png) no-repeat scroll -2px 50%;
border-color:#A5C1D1 -moz-use-text-color #A5C1D1 #A5C1D1;
border-style:outset none outset outset;
border-width:1px medium 1px 1px;
display:block;
height:90px;
margin-top:-45px;
position:fixed;
right:0;
top:40%;
width:25px;
z-index:100001;
}
Run Code Online (Sandbox Code Playgroud)
替代文字http://www.balexandre.com/temp/2009-09-23_1450.png
尝试申请你的代码:)