Javascript 移动启动页

Javascript 移动启动页,javascript,Javascript,我已经有了一个移动站点,我想做的是添加一个图像,当你点击页面5秒钟时显示出来。一旦5秒钟过去,它就消失了,你就在主页上了 对于android设备,这可能吗?有没有办法使图像显示在整个屏幕上 谢谢 使用jQuery更容易。您可以将div样式设置为初始页面,并将函数设置为在加载页面时运行。5秒后,您可以隐藏div 它可能看起来像这样: $('div.introDiv').animate( { opacity: 'toggle' // if div is hidden, it will fad

我已经有了一个移动站点,我想做的是添加一个图像,当你点击页面5秒钟时显示出来。一旦5秒钟过去,它就消失了,你就在主页上了

对于android设备,这可能吗?有没有办法使图像显示在整个屏幕上


谢谢

使用jQuery更容易。您可以将
div
样式设置为初始页面,并将函数设置为在加载页面时运行。5秒后,您可以隐藏
div

它可能看起来像这样:

$('div.introDiv').animate( {
    opacity: 'toggle' // if div is hidden, it will fade in
},
{
    duration: 5000, // in ms
    complete: function () {
        $('div.introDiv').animate(
            {
                opacity: 'toggle' // div will fade out
            },
            {
                duration: 5000, // 5 seconds
                complete:function () {                        
                    // hide div and show main content
                }
            })
    }
}
))

这不是唯一的方法,但它是有效的。

试试像

<body onload="redirectMobile()">

var redirectMobile = function() {
  setTimeout(function(){
    window.location = 'http://www.google.com/';
  },5000);
};

var redirectMobile=function(){
setTimeout(函数(){
window.location=http://www.google.com/';
},5000);
};
或者跳过函数并执行

<body onload="setTimeout(function(){window.location = 'http://www.google.com/'},5000)">

正如前面的回答所说,jquery或其他方法可能更简单,但这应该适用于纯javascript