Appery Click Coding for Javascript
I want to ask is there a Click function for Javascript,
Where user Click a Image Component , Another Image appear for multiply times as the user click.
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
I want to ask is there a Click function for Javascript,
Where user Click a Image Component , Another Image appear for multiply times as the user click.
Hello David,
You can add click event handler for any component. http://docs.appery.io/documentation/w...
Can it be done in Javascript?
Since i may be using "if" "else" when is the user click repeatly and different image appear on a same image component
Sure, you can do it. Just save count of clicks in localStorage.
For example:
var clicks = parseInt(localStorage.getItem("clicks"));
if (clicks ) == 0){
Apperyio("imageName").attr("src","http://example.com/image1.png");
} else {
Apperyio("imageName").attr("src","http://example.com/image2.png");
}
localStorage.setItem("clicks", clicks + 1);
Note: imageName - name of image component