I’ve made a drop down menu, it almost works, but when someone choose a product category from the dropdown menu, i want it to link to an product category page and then close the strip i use as the dropdown menu…
i wanted to make an OnClick event that closes the strip and linking the button to a page? - But the button does not work, when i’ve made an OnClick event… Any ideas or suggestions?
I’ve added an image to show the dropdown menu i have made
Having both link and onClick is not a good practice, as you define two different behaviours for a button.
As a solution, at the end of your onClick function, use wixLocation.to .
Hello, Im trying the same thing but a bit complicated and I can’t make that link to work. I’m trying to create a button (with an icon that is a custom image) that after clicking:
leads to another page of my website
hides itself revealing what is underneath
The problem I have so far is that whenever I apply onClick to any icon the link just doesn’t work on click even if its there. I tried to link the page via the button editor and also via onClick code and there is no way i can make the icon to lead anywhere. It works as soon as I take out the onClick thingy.
I’m facing a similar issue.
I’m trying to attach a trackevent to a button click. It seems to work fine when the link on the button is to an external page e.g. Google. But when the link is to another page on my own website , the link does not work, although the event does get triggered.
I tried your suggetion of WIxLocation.to (“/page”) given above, but am getting an "Unexpected token " error message - it seems to have a problem with the period between wix and location.
Actually, i can’t se what the problem should be, can you maybe take a screen shot of your code?
An unexpected token, comes from a minor mistake forexample, you forgot the " } " in the en of the code, then there will come an unexpected token… So maybe just an missing symbol, or something, but send me a screenshot, then i can see if i can figure out where the problem is
Hi Liran and Roi,
I agree on " define two different behaviors for a button " is not good.
But in the case on GA event it is necessary.
In addition it contradicts this:
Therefore it is a bug, and using wixLocation is a workaround to live with the bug.
Best,