像jQuery的网站介绍Flash?

时间:2011-06-13 22:51:41

标签: jquery css

是否可以使用jQuery / CSS做一些看起来像flash介绍的网站?在向用户显示内容之前,我只需要在几秒钟内显示带有徽标的黑屏。我的意思是,我可以尝试只显示div的内容,但我不知道如何让div适合整个屏幕...类似于:

$(document).ready(function() {
$(body not(#intro-covering-page)).css("display", "none");
$('#intro-covering-page').delay(2000).fadeOut();
}); /* I still haven't figured how to properly make this work*/

并且可能拥有主容器之前。有什么想法吗?

2 个答案:

答案 0 :(得分:1)

让你的CSS隐藏#intro-covering-page

#intro-covering-page {
   display: none;
}

然后使用js

$(function() { // that's short for  .ready()
    $('#intro-covering-page').delay(2000).fadeIn();
});

当然,如果我们想确定用户的js状态,我们会做类似的事情

.js #intro-covering-page {
   display: none;
}

JavaScript的:

$(function() {
    $('html').addClass('js');
    $('#intro-covering-page').delay(2000).fadeIn();
});

答案 1 :(得分:0)

这将适合整个屏幕,但如果它弹出太晚可能看起来很奇怪,所以你必须以这种或那种方式使它看起来很好。

css = {
    'width' : $(window).width(),
    'height' : $(window).height(),
    'position' : 'absolute',
    'background-color' : '#000000'
}

$(document).ready(function() {
    $(#intro-covering-page).css(css);
    $('#intro-covering-page').delay(2000).fadeOut();
});
相关问题