Nureddin Akpinar
Posts: 0
Joined: Sat May 24, 2014 12:04 pm

change photos

hi katya

  1. click to open the image;

    Image

  2. click to open the image;

    Image

  3. click to open the image;

    Image

  4. click to open the image;

    Image

    As in the example.
    I want the picture to change every clicks.

    katya (mobileimage_168) component will change each click photos
    1 click .hasta.png
    2 click izinli.png
    3 click mevcut.png
    4 click yok.png

    Waiting for your help.
    Thank you.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

change photos

Hi Nureddin,

Use the following code:prevar array = ["hasta.png", "izinli.png", "mevcut.png", "yok.png"];

var fileId = parseInt(localStorage.getItem("fileId")) || 0 ;

if (fileId === (array.length - 1)){
fileId = 0;
}

Apperyio("mobileimage_33").attr("src", Appery.getImagePath(array[fileId]));/pre

Nureddin Akpinar
Posts: 0
Joined: Sat May 24, 2014 12:04 pm

change photos

Image

Hello katya, thank you for the quick reply

I've added the code.
but the picture has not changed
Can you please check again

thank you

Nureddin Akpinar
Posts: 0
Joined: Sat May 24, 2014 12:04 pm

change photos

Click the picture has not changed, but

Image

Nureddin Akpinar
Posts: 0
Joined: Sat May 24, 2014 12:04 pm

change photos

I added media manager

Image

Nureddin Akpinar
Posts: 0
Joined: Sat May 24, 2014 12:04 pm

change photos

media manager I've added photos

Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

change photos

Hello Nureddin,

Please make sure that elements in array (var array = ["hasta.png", "izinli.png", "mevcut.png", "yok.png"];) match the names of files that you've uploaded with Media manager. Also you should somewhere increment value fileId: localStorage.setItem("fileId",fileId+ 1);

Nureddin Akpinar
Posts: 0
Joined: Sat May 24, 2014 12:04 pm

change photos

I did it
Thank you
Thank you app team

Nureddin Akpinar
Posts: 0
Joined: Sat May 24, 2014 12:04 pm

change photos

hay

the open the picture in random.
i want to open the picture in order.
what can i do

I'm using the code below:

var array = ["hasta.png", "izinli.png", "mevcut.png", "yok.png"];
var fileId = parseInt(localStorage.getItem("fileId")) || 0 ;
if (fileId === (array.length - 1)){
fileId = 0;
}
Apperyio("mobileimage_33").attr("src", Appery.getImagePath(array[fileId]));
localStorage.setItem("fileId",fileId+ 1);

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

change photos

Hi Nureddin,

This code displays images in the order they are in an array.

Return to “Issues”