JS implements a picture to show the waterfall effect (a simple example)

time:17-01-20 forum:HTML web page, JS language and code
  http://www.bkjia.com/Javascript/1157440.html

I do not know, you have found that the general picture display site will use the waterfall flow effect, the predicate waterfall stream
is not a picture on the web site. The sub is cached, but when you roll to a certain distance, the
picture will continue to cache, and the picture is random, just the same width, the height is not
like the waterfall, so it is called the waterfall effect. Next, I'll give you the code. Let's try some pictures at

[code]
.lt; HTML lang=.quot; en.quot;.Gt;
.lt; head.gt;
! Box ul{float: left; width: 200px; margin-right: 50px;}
#box img{width: 200px. L.gt;
.Lt; /div.gt;
.Lt; script.gt;
var box=document.getElementById ('box');
>. .
var newli=document.createElement ('li');
newli.innerHTML='.lt; img src=.quot; images/' srcNum'.png.quot; alt=.quot;'li';' / / this is the file name of the picture, and the requirements are unified.
var minH=Math.min (ul.#91; 0.#93;.ClientHeight, ul.#91; 1.#93;.ClientHeight, ul.#91; 2.#93;.ClientHeight). }
}
ul.#91; x.#93;.AppendChild (newli);
}
for (VaR I = 0). UmentElement.scrollHeight;
var scrollT=document.body.scrollTop||document.documentElement.scrollTop;
if (winH-scrollT-viewH.lt; 500) {
for (VaR I = 0; I VaR; 20; > > > > > >; />.lt; /html.gt; [/code]

prev:11 major hospitals can provide a "networ... next:Dynamic pricing is too scary! Ji'nan net...
post comment
Notice



approved   2017 SONY children's life is a conce...   Massaging the acupoints can relieve ...   Baby swimming pool built in Britain   The survival record of women scienti...   The Russian 4 year old girl walked 3...
rand   A scalable layer JS with a buffering...   Html is on the page, and the backgro...   Div floating center single div box a...   JavaScript open source cross platfor...   The 9 best JavaScript development to...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com