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.
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