Page 1 of 3
change photos
Posted: Sat May 24, 2014 12:04 pm
by Nureddin Akpinar
Hi
i want to add four different picture to an image.
the picture should change with another picture when i click to the picture . how can i do that can you very much from advance
var imageNumber = parseInt(localStorage.getItem("imageNumber"));
var image = '';
switch(imageNumber){
case 1:{
image = "LinkToImage1.jpg";
break;
}
case 2:{
image = "LinkToImage2.jpg";
break;
}
case 3:{
image = "LinkToImage3.jpg";
break;
}
case 4:{
image = "LinkToImage4.jpg";
break;
}
}
localStorage.setItem("imageNumber", imageNumber + 1);
change photos
Posted: Sat May 24, 2014 1:50 pm
by Igor
Hello,
You can set image to the image component using below code. You can execute this code on button click event.
pre
Apperyio("mobileimage").attr("src","ImagePath");
/pre
where ImagePath - path to the image.
Getting image path:
http://devcenter.appery.io/documentat...
change photos
Posted: Tue May 27, 2014 7:03 am
by Nureddin Akpinar
Hi igor
Thanks for the reply.
I tried didn't work.
where this Code apply.
change photos
Posted: Tue May 27, 2014 7:20 am
by Kateryna Grynko
Hi Nureddin,
Run this JS on button Click event. Make sure you use the correct names.
How do you do this?
change photos
Posted: Tue May 27, 2014 7:57 am
by Nureddin Akpinar
I added the following code to the click event of the image, but it's not.
I want to change the image of each click.
would you help me in detail.
Apperyio ("mobileimage") attr ("src", "ımagepath");
change photos
Posted: Tue May 27, 2014 11:08 am
by Kateryna Grynko
Hi Nureddin,
'imagepath' must contain the image path. What image do you use? Please make sure you use correct names.
change photos
Posted: Tue May 27, 2014 3:11 pm
by Nureddin Akpinar
Png extension added to the picture I'm using for app
change photos
Posted: Tue May 27, 2014 4:54 pm
by Evgene Karachevtsev
Hello,
You should run this JS code on click event:
codeAppery("mobileimage_33").attr("src",Appery.getImagePath("Proxy.PNG"));/code
where mobileimage_33 is the name of image component and "Proxy.PNG" is the name of image file that you uploaded via Media Manager: http://devcenter.appery.io/documentat...
change photos
Posted: Wed May 28, 2014 4:45 pm
by Nureddin Akpinar
Hi
I added the code you gave, I did everything right.
but it's not.
It shows all the pictures I added.
I want to show a picture of every click
detailed help please
change photos
Posted: Thu May 29, 2014 2:46 am
by Yurii Orishchuk
Hi Nureddin.
Currently it's hard to help you cause of your problem is not clear for us now
Please provide us public link for your application.
And provide full steps how we can reproduce your issue.
Also please describe in details what you want to implement. Use screen shots to clarify it.
Thanks & regards.