We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi again. I tried to search for this problem but I didnt find any question like this one. Maybe im stupid idk.
My problem is that when I press the link created, it redirect me to the top of page, and it is really annoying xD. Probably have an easy solution. I dont want the link redirect me anywhere. How can I change this ?
Answers
When you invoke createA(), do you pass a String as its 3rd target parameter?
https://p5js.org/reference/#/p5/createA
Take a look at this online sketch example using createA(): O:-)
http://Bl.ocks.org/GoSubRoutine/bef70ffdae5e1a052ade9c6b15f737cc
Oh, no. You mean "_blank" or "_self" etc. No, I dont need to. Im using the link to show an image in the same page.
The problem is that every time press it, it jumps right to the top of the page
If I pass "#/" it STOP JUMPING <3
https://stackoverflow.com/questions/3252730/how-to-prevent-a-click-on-a-link-from-jumping-to-top-of-page
If your image got an id attribute, you should be able to createA() to it using '#' + image's id.
In order to give an id to any p5.Element, call its method id():
https://p5js.org/reference/#/p5.Element/id