CSS3,HTML,js制作幻灯片式图片产品展示效果id1125-网页前端设计

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Document</title>
  6. <script src="https://cdnjs.cloudflare.com/ajax/libs/PreloadJS/1.0.1/preloadjs.js"></script>
  7. <style>
  8. @import url('https://fonts.googleapis.com/css?family=Rubik:300,400,700');
  9. body {
  10. background: black;
  11. color: #fff;
  12. font-family: 'Rubik', sans-serif;
  13. }
  14. .main-container {
  15. position: absolute;
  16. top: 0;
  17. bottom: 0;
  18. left: 0;
  19. right: 0;
  20. background: black;
  21. overflow: hidden;
  22. z-index: 1;
  23. perspective: 400px;
  24. transition: opacity .3s;
  25. }
  26. .img {
  27. position: absolute;
  28. overflow: hidden;
  29. left: 0;
  30. top: 0;
  31. right: 0;
  32. bottom: 0;
  33. background-color: transparent;
  34. background-position: center center;
  35. background-repeat: no-repeat;
  36. background-size: cover;
  37. opacity: 0;
  38. }
  39. .title {
  40. display: block;
  41. position: absolute;
  42. width: 200%;
  43. top: 50%;
  44. left: -50%;
  45. transform: translateY(-50%);
  46. font-size: 6em;
  47. text-align: center;
  48. color: #FFF;
  49. font-weight: 700;
  50. letter-spacing: .07em;
  51. text-transform: uppercase;
  52. opacity: 0;
  53. z-index: 5;
  54. }
  55. .info-container {
  56. position: absolute;
  57. left: 20%;
  58. top: 0;
  59. right: 20%;
  60. bottom: 0;
  61. display: flex;
  62. justify-content: center;
  63. align-items: center;
  64. flex-direction: column;
  65. text-align: center;
  66. transform: translateY(100%);
  67. opacity: 0;
  68. z-index: 5;
  69. }
  70. .info-container h3 {
  71. font-size: 2.6em;
  72. font-weight: 400;
  73. letter-spacing: .05em;
  74. margin: 0 0 .5em 0;
  75. padding: 0;
  76. }
  77. .info-container h4 {
  78. font-size: 1.7em;
  79. font-weight: 400;
  80. margin: 1.4em 0 .8em 0;
  81. padding: 0;
  82. text-transform: uppercase;
  83. letter-spacing: .1em;
  84. }
  85. .info-container h5 {
  86. font-size: 1.3em;
  87. font-weight: 300;
  88. margin: 1.5em 0 .5em 0;
  89. padding: 0;
  90. text-transform: uppercase;
  91. }
  92. .info-container p {
  93. font-size: 1.2em;
  94. margin: 0;
  95. padding: 0;
  96. line-height: 1.6;
  97. }
  98. .info-container a {
  99. color: #fff;
  100. text-decoration: none;
  101. opacity: .6;
  102. transition: all .3s;
  103. }
  104. .info-container a:hover {
  105. opacity: 1;
  106. }
  107. .main-container.loaded .loader-container {
  108. display: none;
  109. }
  110. .main-container.loaded .img,
  111. .main-container.loaded .info-container {
  112. opacity: 1;
  113. }
  114. .main-container.loaded .title {
  115. opacity: 0;
  116. }
  117. .main-container.loaded .img-1 {
  118. background-image: url(architecture-bridge-golden-gate-bridge-220765.jpg);
  119. animation: kenburns-top 6s linear both reverse 0.5s, fade-out 2s ease-in forwards 5.5s;
  120. z-index: 5;
  121. }
  122. .main-container.loaded .img-2 {
  123. background-image: url(j.jpg);
  124. animation: kenburns-bottom 6s linear both 5.5s, fade-out 2s ease-in forwards 10.5s;
  125. z-index: 4;
  126. }
  127. .main-container.loaded .img-3 {
  128. background-image: url(london-3841024_1920.jpg);
  129. animation: kenburns-right 6s linear both reverse 10.5s, fade-out 2s ease-in forwards 15.5s;
  130. z-index: 3;
  131. }
  132. .main-container.loaded .img-4 {
  133. background-image: url(new.jpg);
  134. animation: kenburns-left 6s linear both 15.5s, fade-out 2s ease-in forwards 20.5s;
  135. z-index: 2;
  136. }
  137. .main-container.loaded .img-5 {
  138. background-image: url(people-2568954_1920.jpg);
  139. animation: kenburns-right 7s linear both reverse 20.5s, fade-out 3s ease-in forwards 24.5s;
  140. z-index: 1;
  141. }
  142. .main-container.loaded .title-1 {
  143. animation: focus-in-contract 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards 1.8s, text-blur-out 1.2s ease-in forwards 5.5s;
  144. }
  145. .main-container.loaded .title-2 {
  146. animation: focus-in-contract 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards 6.8s, text-blur-out 1.2s ease-in forwards 10.5s;
  147. }
  148. .main-container.loaded .title-3 {
  149. animation: focus-in-contract 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards 11.8s, text-blur-out 1.2s ease-in forwards 15.5s;
  150. }
  151. .main-container.loaded .title-4 {
  152. animation: focus-in-contract 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards 16.8s, text-blur-out 1.2s ease-in forwards 20.5s;
  153. }
  154. .main-container.loaded .title-5 {
  155. animation: focus-in-contract 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards 21.8s, text-blur-out 1.6s ease-in forwards 25.5s;
  156. }
  157. .main-container.loaded .info-container {
  158. opacity: 0;
  159. animation: slide-in-bottom 12s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards 26.5s;
  160. }
  161. @keyframes kenburns-top {
  162. 0% {
  163. transform: scale(1) translateY(0);
  164. transform-origin: 50% 16%;
  165. }
  166. 100% {
  167. transform: scale(1.25) translateY(-15px);
  168. transform-origin: top;
  169. }
  170. }
  171. /**
  172. * ----------------------------------------
  173. * animation kenburns-bottom
  174. * ----------------------------------------
  175. */
  176. @keyframes kenburns-bottom {
  177. 0% {
  178. transform: scale(1) translateY(0);
  179. transform-origin: 50% 84%;
  180. }
  181. 100% {
  182. transform: scale(1.25) translateY(15px);
  183. transform-origin: bottom;
  184. }
  185. }
  186. /**
  187. * ----------------------------------------
  188. * animation kenburns-right
  189. * ----------------------------------------
  190. */
  191. @keyframes kenburns-right {
  192. 0% {
  193. transform: scale(1) translate(0, 0);
  194. transform-origin: 84% 50%;
  195. }
  196. 100% {
  197. transform: scale(1.25) translateX(20px);
  198. transform-origin: right;
  199. }
  200. }
  201. /**
  202. * ----------------------------------------
  203. * animation kenburns-left
  204. * ----------------------------------------
  205. */
  206. @keyframes kenburns-left {
  207. 0% {
  208. transform: scale(1) translate(0, 0);
  209. transform-origin: 16% 50%;
  210. }
  211. 100% {
  212. transform: scale(1.25) translate(-20px, 15px);
  213. transform-origin: left;
  214. }
  215. }
  216. /**
  217. * ----------------------------------------
  218. * animation focus-in-contract
  219. * ----------------------------------------
  220. */
  221. @keyframes focus-in-contract {
  222. 0% {
  223. letter-spacing: 1em;
  224. filter: blur(12px);
  225. opacity: 0;
  226. }
  227. 100% {
  228. filter: blur(0px);
  229. opacity: 1;
  230. }
  231. }
  232. /**
  233. * ----------------------------------------
  234. * animation tracking-in-contract
  235. * ----------------------------------------
  236. */
  237. @keyframes tracking-in-contract {
  238. 0% {
  239. letter-spacing: 1em;
  240. opacity: 0;
  241. }
  242. 40% {
  243. opacity: 0.6;
  244. }
  245. 100% {
  246. letter-spacing: normal;
  247. opacity: 1;
  248. }
  249. }
  250. /**
  251. * ----------------------------------------
  252. * animation fade-out
  253. * ----------------------------------------
  254. */
  255. @keyframes fade-out {
  256. 0% {
  257. opacity: 1;
  258. }
  259. 100% {
  260. opacity: 0;
  261. }
  262. }
  263. /**
  264. * ----------------------------------------
  265. * animation fade-in
  266. * ----------------------------------------
  267. */
  268. @keyframes fade-in {
  269. 0% {
  270. opacity: 0;
  271. }
  272. 100% {
  273. opacity: 1;
  274. }
  275. }
  276. /**
  277. * ----------------------------------------
  278. * animation text-blur-out
  279. * ----------------------------------------
  280. */
  281. @keyframes text-blur-out {
  282. 0% {
  283. filter: blur(0.01);
  284. }
  285. 100% {
  286. filter: blur(12px) opacity(0%);
  287. }
  288. }
  289. /**
  290. * ----------------------------------------
  291. * animation slide-in-bottom
  292. * ----------------------------------------
  293. */
  294. @keyframes slide-in-bottom {
  295. 0% {
  296. transform: translateY(100%);
  297. opacity: 0;
  298. }
  299. 100% {
  300. transform: translateY(0);
  301. opacity: 1;
  302. }
  303. }
  304. /**
  305. * ----------------------------------------
  306. * animation rotate-center
  307. * ----------------------------------------
  308. */
  309. @keyframes rotate-center {
  310. 0% {
  311. transform: rotate(0);
  312. }
  313. 100% {
  314. transform: rotate(360deg);
  315. }
  316. }
  317. .preloaded {
  318. position: absolute;
  319. bottom: -1px;
  320. left: -1px;
  321. width: 1px;
  322. height: 1px;
  323. overflow: hidden;
  324. visibility: hidden;
  325. }
  326. .loader-container {
  327. position: absolute;
  328. top: 0;
  329. bottom: 0;
  330. left: 0;
  331. right: 0;
  332. text-align: center;
  333. font-size: .9em;
  334. letter-spacing: .13em;
  335. text-transform: uppercase;
  336. font-weight: 400;
  337. color: #fff;
  338. background: transparent;
  339. display: flex;
  340. flex-direction: column;
  341. justify-content: center;
  342. align-content: center;
  343. z-index: 5;
  344. }
  345. .loader {
  346. width: 42px;
  347. height: 42px;
  348. margin-bottom: 10px;
  349. align-self: center;
  350. border-radius: 50%;
  351. background: whiteSmoke;
  352. box-shadow: 0px -10px 25px 0px #ffffff inset;
  353. background: linear-gradient(to right, #ffffff 50%, transparent 50%);
  354. opacity: .8;
  355. animation: rotate-center 0.7s infinite linear;
  356. }
  357. .loader:before {
  358. display: block;
  359. content: '';
  360. position: relative;
  361. top: 50%;
  362. left: 50%;
  363. transform: translate(-50%, -50%);
  364. width: 39px;
  365. height: 39px;
  366. border-radius: 50%;
  367. background: black;
  368. }
  369. </style>
  370. </head>
  371. <body>
  372. <div class="main-container">
  373. <div class="img img-1"></div>
  374. <div class="img img-2"></div>
  375. <div class="img img-3"></div>
  376. <div class="img img-4"></div>
  377. <div class="img img-5"></div>
  378. <div class="title title-1">San Francisco</div>
  379. <div class="title title-2">Hong Kong</div>
  380. <div class="title title-3">London</div>
  381. <div class="title title-4">New York</div>
  382. <div class="title title-5">Tokyo</div>
  383. <div class="loader-container">
  384. <div class="loader"> </div>
  385. <p>Loading images...</p>
  386. </div>
  387. </div>
  388. <div class="preloaded"></div>
  389. <script>
  390. var preloaded = document.querySelector('.preloaded');
  391. var queue = new createjs.LoadQueue(true,null,true);
  392. queue.on('fileload', handleLoad, this);
  393. queue.on('progress', handleProgress, this);
  394. queue.on('complete', handleComplete, this);
  395. queue.loadManifest([
  396. {
  397. id: 'sf',
  398. crossOrigin: true,
  399. type: createjs.Types.IMAGE,
  400. src: 'https://images.unsplash.com/photo-1501594907352-04cda38ebc29?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&s=35233ecf7c2f6b1b99123374610926fe'
  401. },
  402. {
  403. id: 'hk',
  404. crossOrigin: true,
  405. type: createjs.Types.IMAGE,
  406. src: 'https://images.unsplash.com/photo-1507941097613-9f2157b69235?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&s=f8f33afdfc69b16d51c996cf3a8cc1c7'
  407. },
  408. {
  409. id: 'lon',
  410. crossOrigin: true,
  411. type: createjs.Types.IMAGE,
  412. src: 'https://images.unsplash.com/photo-1506501139174-099022df5260?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&s=4868d202b74b7a313bb34a3d8526428c'
  413. },
  414. {
  415. id: 'nyc',
  416. crossOrigin: true,
  417. type: createjs.Types.IMAGE,
  418. src: 'https://images.unsplash.com/photo-1480714378408-67cf0d13bc1b?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&s=d8f8d728cc689063536174ec02129ebc'
  419. },
  420. {
  421. id: 'tok',
  422. crossOrigin: true,
  423. type: createjs.Types.IMAGE,
  424. src: 'https://images.unsplash.com/photo-1505814360303-5bfcf2a8acb6?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&s=86aaa627e11ca46f2177787d563de340'
  425. }
  426. ]);
  427. function handleProgress(event) {
  428. console.log(event.progress);
  429. }
  430. function handleLoad(event) {
  431. // console.log(event);
  432. var img = new Image();
  433. // img.crossOrigin = 'Anonymous';
  434. img.src = event.item.src;
  435. preloaded.appendChild(img);
  436. // var img = queue.getResult('image',true);
  437. // preloaded.appendChild(event.result);
  438. }
  439. function handleComplete() {
  440. document.querySelector('.main-container').classList.add('loaded');
  441. console.log('done');
  442. }
  443. </script>
  444. </body>
  445. </html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/PreloadJS/1.0.1/preloadjs.js"></script>
    <style>
    
     @import url('https://fonts.googleapis.com/css?family=Rubik:300,400,700');
body {
  background: black;
  color: #fff;
  font-family: 'Rubik', sans-serif;
}
.main-container {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: black;
  overflow: hidden;
  z-index: 1;
  perspective: 400px;
  transition: opacity .3s;
}
.img {
  position: absolute;
  overflow: hidden;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background-color: transparent;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
}
.title {
  display: block;
  position: absolute;
  width: 200%;
  top: 50%;
  left: -50%;
  transform: translateY(-50%);
  font-size: 6em;
  text-align: center;
  color: #FFF;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  opacity: 0;
  z-index: 5;
}
.info-container {
  position: absolute;
  left: 20%;
  top: 0;
  right: 20%;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  transform: translateY(100%);
  opacity: 0;
  z-index: 5;
}
.info-container h3 {
  font-size: 2.6em;
  font-weight: 400;
  letter-spacing: .05em;
  margin: 0 0 .5em 0;
  padding: 0;
}
.info-container h4 {
  font-size: 1.7em;
  font-weight: 400;
  margin: 1.4em 0 .8em 0;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.info-container h5 {
  font-size: 1.3em;
  font-weight: 300;
  margin: 1.5em 0 .5em 0;
  padding: 0;
  text-transform: uppercase;
}
.info-container p {
  font-size: 1.2em;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}
.info-container a {
  color: #fff;
  text-decoration: none;
  opacity: .6;
  transition: all .3s;
}
.info-container a:hover {
  opacity: 1;
}
.main-container.loaded .loader-container {
  display: none;
}
.main-container.loaded .img,
.main-container.loaded .info-container {
  opacity: 1;
}
.main-container.loaded .title {
  opacity: 0;
}
.main-container.loaded .img-1 {
  background-image: url(architecture-bridge-golden-gate-bridge-220765.jpg);
  animation: kenburns-top 6s linear both reverse 0.5s, fade-out 2s ease-in forwards 5.5s;
  z-index: 5;
}
.main-container.loaded .img-2 {
  background-image: url(j.jpg);
  animation: kenburns-bottom 6s linear both 5.5s, fade-out 2s ease-in forwards 10.5s;
  z-index: 4;
}
.main-container.loaded .img-3 {
  background-image: url(london-3841024_1920.jpg);
  animation: kenburns-right 6s linear both reverse 10.5s, fade-out 2s ease-in forwards 15.5s;
  z-index: 3;
}
.main-container.loaded .img-4 {
  background-image: url(new.jpg);
  animation: kenburns-left 6s linear both 15.5s, fade-out 2s ease-in forwards 20.5s;
  z-index: 2;
}
.main-container.loaded .img-5 {
  background-image: url(people-2568954_1920.jpg);
  animation: kenburns-right 7s linear both reverse 20.5s, fade-out 3s ease-in forwards 24.5s;
  z-index: 1;
}
.main-container.loaded .title-1 {
  animation: focus-in-contract 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards 1.8s, text-blur-out 1.2s ease-in forwards 5.5s;
}
.main-container.loaded .title-2 {
  animation: focus-in-contract 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards 6.8s, text-blur-out 1.2s ease-in forwards 10.5s;
}
.main-container.loaded .title-3 {
  animation: focus-in-contract 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards 11.8s, text-blur-out 1.2s ease-in forwards 15.5s;
}
.main-container.loaded .title-4 {
  animation: focus-in-contract 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards 16.8s, text-blur-out 1.2s ease-in forwards 20.5s;
}
.main-container.loaded .title-5 {
  animation: focus-in-contract 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards 21.8s, text-blur-out 1.6s ease-in forwards 25.5s;
}
.main-container.loaded .info-container {
  opacity: 0;
  animation: slide-in-bottom 12s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards 26.5s;
}
 
@keyframes kenburns-top {
  0% {
    transform: scale(1) translateY(0);
    transform-origin: 50% 16%;
  }
  100% {
    transform: scale(1.25) translateY(-15px);
    transform-origin: top;
  }
}
/**
 * ----------------------------------------
 * animation kenburns-bottom
 * ----------------------------------------
 */
@keyframes kenburns-bottom {
  0% {
    transform: scale(1) translateY(0);
    transform-origin: 50% 84%;
  }
  100% {
    transform: scale(1.25) translateY(15px);
    transform-origin: bottom;
  }
}
/**
 * ----------------------------------------
 * animation kenburns-right
 * ----------------------------------------
 */
@keyframes kenburns-right {
  0% {
    transform: scale(1) translate(0, 0);
    transform-origin: 84% 50%;
  }
  100% {
    transform: scale(1.25) translateX(20px);
    transform-origin: right;
  }
}
/**
 * ----------------------------------------
 * animation kenburns-left
 * ----------------------------------------
 */
@keyframes kenburns-left {
  0% {
    transform: scale(1) translate(0, 0);
    transform-origin: 16% 50%;
  }
  100% {
    transform: scale(1.25) translate(-20px, 15px);
    transform-origin: left;
  }
}
/**
 * ----------------------------------------
 * animation focus-in-contract
 * ----------------------------------------
 */
@keyframes focus-in-contract {
  0% {
    letter-spacing: 1em;
    filter: blur(12px);
    opacity: 0;
  }
  100% {
    filter: blur(0px);
    opacity: 1;
  }
}
/**
 * ----------------------------------------
 * animation tracking-in-contract
 * ----------------------------------------
 */
@keyframes tracking-in-contract {
  0% {
    letter-spacing: 1em;
    opacity: 0;
  }
  40% {
    opacity: 0.6;
  }
  100% {
    letter-spacing: normal;
    opacity: 1;
  }
}
/**
 * ----------------------------------------
 * animation fade-out
 * ----------------------------------------
 */
@keyframes fade-out {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
/**
 * ----------------------------------------
 * animation fade-in
 * ----------------------------------------
 */
@keyframes fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
/**
 * ----------------------------------------
 * animation text-blur-out
 * ----------------------------------------
 */
@keyframes text-blur-out {
  0% {
    filter: blur(0.01);
  }
  100% {
    filter: blur(12px) opacity(0%);
  }
}
/**
 * ----------------------------------------
 * animation slide-in-bottom
 * ----------------------------------------
 */
@keyframes slide-in-bottom {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
/**
 * ----------------------------------------
 * animation rotate-center
 * ----------------------------------------
 */
@keyframes rotate-center {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}
.preloaded {
  position: absolute;
  bottom: -1px;
  left: -1px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  visibility: hidden;
}
.loader-container {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: .9em;
  letter-spacing: .13em;
  text-transform: uppercase;
  font-weight: 400;
  color: #fff;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-content: center;
  z-index: 5;
}
.loader {
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  align-self: center;
  border-radius: 50%;
  background: whiteSmoke;
  box-shadow: 0px -10px 25px 0px #ffffff inset;
  background: linear-gradient(to right, #ffffff 50%, transparent 50%);
  opacity: .8;
  animation: rotate-center 0.7s infinite linear;
}
.loader:before {
  display: block;
  content: '';
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: black;
}

    
    
    
    </style>
</head>
<body>
    <div class="main-container">
  <div class="img img-1"></div>
  <div class="img img-2"></div>
  <div class="img img-3"></div>
  <div class="img img-4"></div>
  <div class="img img-5"></div>
  <div class="title title-1">San Francisco</div>
  <div class="title title-2">Hong Kong</div>
  <div class="title title-3">London</div>
  <div class="title title-4">New York</div>
  <div class="title title-5">Tokyo</div>
   
  <div class="loader-container">
    <div class="loader"> </div>
    <p>Loading images...</p>
  </div>
</div>
<div class="preloaded"></div>
   <script>
    
    var preloaded = document.querySelector('.preloaded');
var queue = new createjs.LoadQueue(true,null,true);

queue.on('fileload', handleLoad, this);

queue.on('progress', handleProgress, this);

queue.on('complete', handleComplete, this);

queue.loadManifest([
  {
    id: 'sf',
    crossOrigin: true,
    type: createjs.Types.IMAGE,
    src: 'https://images.unsplash.com/photo-1501594907352-04cda38ebc29?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&s=35233ecf7c2f6b1b99123374610926fe'
  },
  {
    id: 'hk',
    crossOrigin: true,
    type: createjs.Types.IMAGE,
    src: 'https://images.unsplash.com/photo-1507941097613-9f2157b69235?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&s=f8f33afdfc69b16d51c996cf3a8cc1c7'
  },
  {
    id: 'lon',
    crossOrigin: true,
    type: createjs.Types.IMAGE,
    src: 'https://images.unsplash.com/photo-1506501139174-099022df5260?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&s=4868d202b74b7a313bb34a3d8526428c'
  },
  {
    id: 'nyc',
    crossOrigin: true,
    type: createjs.Types.IMAGE,
    src: 'https://images.unsplash.com/photo-1480714378408-67cf0d13bc1b?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&s=d8f8d728cc689063536174ec02129ebc'
  },
  {
    id: 'tok',
    crossOrigin: true,
    type: createjs.Types.IMAGE,
    src: 'https://images.unsplash.com/photo-1505814360303-5bfcf2a8acb6?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&s=86aaa627e11ca46f2177787d563de340'
  }
]);

function handleProgress(event) {
  console.log(event.progress);
}

function handleLoad(event) {
  // console.log(event);
  var img = new Image();
  // img.crossOrigin = 'Anonymous';
  img.src = event.item.src;
  preloaded.appendChild(img);
  // var img = queue.getResult('image',true);
  // preloaded.appendChild(event.result);
}

function handleComplete() {	
  document.querySelector('.main-container').classList.add('loaded');
  console.log('done');
}

    
    
    
    </script> 
</body>
</html>

 在线演示


让链接同时具备两种打开方式

获取源码: CSS3,HTML,js制作幻灯片式图片产品展示效果id1125
下载数:154人次, 文件大小: 2.9 KB, 上传日期: 2020年-12 月-26日

公众号回复:gcode  获取解压密码

qrcode_for_gh_6ea2c28a1709_258 (1)

3,090 人查阅

类似文章