回答
首先的;这不是一个早期的网络效应。这是由图像的大小和您的互联网连接速度和托管上传速度造成的。
无论如何,如果你想有这样的效果,理论上你必须首先加载图像。
加载完每张图片后;你必须追加和屏蔽div,并逐帧动画到底部0。
基本上为您的网页上的所有图片:
CSS
img{
opacity:0;
}
.wrap {
height:0;
overflow:hidden;
}
JS
$(window).load(function(){
var $images = $('img');
$images.each(function(){
var $wrapper = $('<div />').addClass('wrap');
$(this).wrap($wrapper);
$(this).css('opacity', 1);
$(this).parent().animate({
height: '768px'
}, 2000);
});
});
直播JS:
Thx!要试试这个! –
是,对于所有的图像?
对于主图像很容易做到。
您可以创建一个隐藏的div,将图像设置为背景,然后在document.ready()上使用一个非常大的值来使用slideDown;
$(document).ready(function() {
$('#yourdiv').slideDown(99999999);
});
:)
<div style='height: full height of the image'>
<div id='yourdiv'>
</div>
</div>
这是一个很好的答案,但BBox更新slideDown功能,所以我会建议把#yourDiv内固定高度的div – Apolo
我不知道这是不是你在寻找什么,但我扔东西在一起。
我将图像封装在一个div中,并在其中放置一个div,它会缓慢地每秒显示一次图像。我已随机化了它在任何给定时间显示的像素数量,因此看起来更真实一些。
HTML:
<div class="container">
<img id="flowerImage" src="http://i.imgur.com/xWVzyw9.jpg" />
<div class="slowLoader"></div>
</div>
CSS:
#flowerImage{
height: 300px;
}
.slowLoader{
height: 100%;
width: 100%;
position: absolute;
bottom: 0;
left: 0;
background-color: white;
}
.container{
display: inline-block;
width: auto;
height: auto;
position: relative;
}
的jQuery:
$(function(){
var slowLoadHandler = setInterval(function(){
var currentHeight = parseInt($(".slowLoader").css("height"));
if(currentHeight <= 0){
clearInterval(slowLoadHandler);
return;
}
var changeHeight = getRandomArbitary(5,40);
currentHeight = currentHeight - changeHeight;
$(".slowLoader").css("height", currentHeight);
}, 1000);
});
function getRandomArbitary (min, max) {
return Math.floor(Math.random() * (max - min) + min);
}
谢谢! Interersting方法! –
- 1. 网站加载缓慢
- 2. 在网站上缓慢加载iframe
- 3. 毕加索将图像缓慢加载到网络上的回收站视图
- 4. 缓慢加载图像
- 5. Flexslider缓慢图像加载
- 6. 缓慢加载图像
- 7. Magento网站的缓慢加载
- 8. 我的网站缓慢加载
- 9. 网站缓慢加载CSS/jquery样式
- 10. 使用download.aspx时缓慢加载图像
- 11. 的Android - SimpleCursorAdapter缓慢的图像加载
- 12. 有时我的网站上的页面加载非常缓慢
- 13. 桌面视图图像加载缓慢
- 14. 缓慢的图像加载Nativescript
- 15. Javascript图像加载缓慢的ipad
- 16. phonegap应用程序非常缓慢加载网站上的ios
- 17. 缓慢加载godaddy.com上的网站(linux主机)
- 18. 图像在网站上未加载
- 19. 图像不加载在网站上
- 20. 在asp.net网站上缓慢加载第一页
- 21. 从sdcard缓慢加载图像到gridview
- 22. Phonegap:图像加载非常缓慢
- 23. 用Picasso缓慢加载大图像
- 24. 用jQuery插件缓慢加载图像
- 25. 从数据库缓慢加载图像
- 26. MySQL使我的网站加载非常缓慢
- 27. 从网站加载图像
- 28. 缓慢的网络/手机上的图像加载递归链问题
- 29. 在轨道上的红宝石缓慢加载图像
- 30. Google地图缓慢加载
我觉得你的问题是好,我不明白downvotes – Apolo
@Apolo这个问题太广泛,并没有显示研究 –