"pre-load" first image

master
Tomáš Mládek 2021-01-10 00:10:49 +01:00
parent b2f2420df9
commit 18e43839d1
1 changed files with 10 additions and 2 deletions

View File

@ -1,10 +1,18 @@
<template>
<div class="video-scroll" ref="root">
<img v-for="(file, idx) in definition.files"
<img class="visible loaded"
:src="definition.files[0]"
:style="{
top: `${Math.round(definition.top)}px`,
left:`${Math.round(definition.left)}px`,
}"
/>
<img v-for="(file, idx) in definition.files.slice(1)"
:data-src="file"
:style="{
top: `${Math.round(definition.top)}px`,
left: `${Math.round(definition.left) + width * idx}px`,
left: `${Math.round(definition.left) + width * (idx + 1)}px`,
}"
/>