0
CSSJquery .scroll display:none;不工作
#acc-close-all, #to-top {
position: relative;
left: 951px;
width: 29px;
height: 42px;
margin-bottom: 2px;
display:none;
}
#acc-close-all a, #to-top a {
position: absolute;
float: right;
display: block;
height: 42px;
width: 29px;
overflow: hidden;
display:none;
cursor: pointer;
}
HTML
<div id="acc-close-all">
<a title="Close all open tabs"><!----></a>
</div>
<div id="to-top">
<a title="Back to top"><!----></a>
</div>
jQuery的
// Scroll close all and bcak to top buttons with the page
$(window).scroll(function() {
var top = $(this).scrollTop();
$('#acc-close-all a, #to-top a').css('top', top + "px").css("display", "inline");
});
我想這些選項卡淡入慢慢地,當用戶向下滾動頁面,淡化了用戶靠近頂部。
我可以讓它在沒有顯示的情況下工作:none和display:inline,但當用戶向下滾動頁面時它不會顯示。我讀過這http://api.jquery.com/scroll/,但仍然無法實現它的工作。
注意:頁面只有在手風琴打開時纔可以滾動。可以同時打開多個手風琴。
這很酷,但我也希望它在用戶滾動時再次淡出。我怎麼把它放在那裏? – Solidariti 2010-09-09 11:38:23
沒有問題 - 請參閱更新的示例,並注意它如何測試scrollTop值以確定鏈接是否可見或不可見:http://jsfiddle.net/773fV/1/ – Pat 2010-09-09 12:00:12
這真是太棒了,可以減緩淡入淡出? – Solidariti 2010-12-02 00:26:34