我有一个div
需要被垂直居中在屏幕页面滚动股利需要滚动页面后,屏幕的垂直中心
这里后是一个演示 - http://jsfiddle.net/JtZ7F/
<div style="height:1000px; border:1px solid red;">
scroll
<span style="height:150px; width:100px; float:right; border:1px solid green; display:block; position:fixed;top:50%; margin-top:-75px;">
need vertical center of the screen after page scroling
</span>
</div>
现在我使用position:fixed;
,这不是一个解决方案
我想停止页面滚动时,我的绿色框顺利地移动到屏幕的垂直中心。
我该如何在jQuery中做到这一点?
,你能否告诉jQuery的工作,你已经完成的工作? –
为什么'position:fixed'不是您的解决方案? –
@Liam Spencer - 其实我不是jQuery专家。你有没有简单的脚本? – ShibinRagh