Multiple ion screensavers

I am building an application with Ionic v1 and using a plugin with a splash screen from the cordova shell .
I need to show a screen saver with a fixed set of images every time I launch the application.

Is there a way to clear or hack to get multiple bookmarks?

Thanks for any help.

+4
source share
2 answers

This is not possible with the Splash Screen plugin, but you can try it.

First we create an array of images:

$rootScope.image = ["img1.png","img2.png"];

And set the / reset index to select the image:

if(localStorage.getItem('sliderIndex')==null || localStorage.getItem('sliderIndex')==undefined || localStorage.getItem('sliderIndex')==5) localStorage.setItem('sliderIndex',0);

Here is your browse page

<img src="img/{{image[imgIndex]}}" width="100%" height="100%"/>

And set the value to imgIndex:

$scope.imgIndex = localStorage.getItem('sliderIndex');

3 , :

$timeout(function() {
  $location.path("/app/search");
  var data = parseInt(localStorage.getItem('sliderIndex'))+1;
  localStorage.setItem('sliderIndex',data);},3000);
+1

, .

, , [1.png, 2.png, 3.png, 4.png, 5.png] , 1.png, , , 1 ..... ,

0

Source: https://habr.com/ru/post/1679587/


All Articles