我想在頁面加載時有一個div向下滾動,暫停幾秒鐘,然後滾動並關閉。與我們在cnn.com和其他網站上看到的advt橫幅類似。我如何做到這一點?我試圖在document.ready中執行以下操作,但無法使其工作。請幫幫我。在頁面加載時滾動然後滾動
$(document).ready(function(){
function rolldownDiv(){
if ($('#feature-content').is(":hidden"))
{
$('#feature-content').slideDown().delay(10000);
} else {
$('#feature-content').slideUp().delay(10000);
}
return false;
}
rolldownDiv();
});
而且我有以下爲「特色內容」 CSS DIV:
/* Mozilla ignores crazy MS image filters, so it will skip the last line in the
following */
#feature-content {
float:left;
width: 950px;
margin: auto;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='images/transparent.png');
display:none;
}
/* IE ignores styles with [attributes], so it will skip the following. */
#feature-content[id] {
float:left;
width: 950px;
margin: auto;
background-image:url(images/transparent.png);
display:none;
}