Quote from
Phil78 on March 23, 2023, 8:50 pm
I made a slideshow that works well by loading the image at each scroll in a container that contains the following html
<img src="[source]" alt="." width="auto" height="97%">
but it seems that it saturates the memory quickly especially under android.
Looking at other methods on the internet, I tried loading all the images first then making them visible or invisible.
I created an image in a container that I duplicate with a different source but I can't see anything on the display.
I also tried the same method with a container instead of an image but I get an Uncaught TypeError: e is null
SetObjectHTML http://localhost/Diapo-Web/js/main.js:2
// --Subroutine getImages
CreateEmptyArray [images]
SetVar [tempo] [resp]
SetVar [z] 0
Loop 2 [tempo.length-1] [i]
ArrayAddItem [images] [tempo([i])]
SetVar [source] "uploads/[Annee]/[Evt]/[images([z])]"
if [z] > 0
DuplicateObject "Image0" "Image[z]" "ContMilieux"
endif
// --in case of image
SetObjectAttribute "Image[z]" "src" [source]
// -- in case of container
SetObjectHTML "Image[z]" '<img src="[source]" alt="." width="auto" height="97%">'
Math "[z]+1" 0 [z]
EndLoop
SetVar [n] 0
Affiche 0
// --Subroutine Affiche
if [sens] == undefined
SetVar [sens] 1
Endif
if [n] > 0
HideObject "Image[n]" "none" 0
Endif
Math "[n]+[sens]" 0 [n]
ShowObject "Image[n]" "none" 0
I made a slideshow that works well by loading the image at each scroll in a container that contains the following html
<img src="[source]" alt="." width="auto" height="97%">
but it seems that it saturates the memory quickly especially under android.
Looking at other methods on the internet, I tried loading all the images first then making them visible or invisible.
I created an image in a container that I duplicate with a different source but I can't see anything on the display.
I also tried the same method with a container instead of an image but I get an Uncaught TypeError: e is null
SetObjectHTML http://localhost/Diapo-Web/js/main.js:2
// --Subroutine getImages
CreateEmptyArray [images]
SetVar [tempo] [resp]
SetVar [z] 0
Loop 2 [tempo.length-1] [i]
ArrayAddItem [images] [tempo([i])]
SetVar [source] "uploads/[Annee]/[Evt]/[images([z])]"
if [z] > 0
DuplicateObject "Image0" "Image[z]" "ContMilieux"
endif
// --in case of image
SetObjectAttribute "Image[z]" "src" [source]
// -- in case of container
SetObjectHTML "Image[z]" '<img src="[source]" alt="." width="auto" height="97%">'
Math "[z]+1" 0 [z]
EndLoop
SetVar [n] 0
Affiche 0
// --Subroutine Affiche
if [sens] == undefined
SetVar [sens] 1
Endif
if [n] > 0
HideObject "Image[n]" "none" 0
Endif
Math "[n]+[sens]" 0 [n]
ShowObject "Image[n]" "none" 0