我尝试打开全屏图像 2 秒钟,然后关闭图像。图像关闭后,会显示另一个元素。
$("#explosion-image").attr('src', %image_url%);
$("#explosion-image").css({
height:'100%', width:'100%', position:'fixed', top:0, left:0
});
$("#explosion-image").show();
$("#explosion-image").delay(2000);
$("#explosion-image").hide();
$("#explosion-image").attr('src', '');
$("#div-to-open").show();
此代码仅打开图像,而不执行任何操作:(
感谢您提前提供帮助
最佳答案
试试这个 fiddle :
http://jsfiddle.net/maniator/JhcGb/
$("#explosion-image").css({
height: '100%',
width: '100%',
position: 'fixed',
top: 0,
left: 0,
display: 'none'
}).show()
setTimeout(function() {
$("#div-to-open").show();
$("#explosion-image").hide();
}, 2000)
关于javascript - 显示全屏图像,等待 2 秒,关闭图像,打开 div - javascript/jquery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5491055/