Code not working on subpage?

Hi community,

is it possible that the same code works on my home page and doesn’t work on subpage? Do I need to something turn on?

export function button1_click(event) {
$w(‘#box1’).show(“fade”)
}

export function vectorImage1_click(event) {
$w(‘#box1’).hide(“fade”)
}

I work with Corvid for the first time, so maybe I overlook something but I really don’t know anymore.

Thank you in advance for any help

Your question is a bit too broad. Or: what exactly are you meaning. The short answer to your question is “yes”, but I´m afraid that won´t help much. So give us just a tiny bit more info on what you are trying to achieve and how.

Keep in mind that there is site code and page code

I’d not be surprised if the elements on your second page have different names and you probably need to assign the event handlers using the Properties panel again.

https://support.wix.com/en/article/corvid-working-in-the-code-panel#wix-code-syntax-and-autocomplete
https://support.wix.com/en/article/corvid-reacting-to-user-actions-using-events

Hi Giri Zano,

thanks for your reply.

I want to make a simple car rental site. I used Corvid because I wanted the overlap (hover) effect when it clicked on the price.

I did it. So I wanted to do a subpage with all the cars in the same way.

Currently everything works for me except cars in the first column. I do not understand why. The code is still the same.

In addition, I found out that in Safari the elements overlap in different ways and 90% of all cars disappeared completely in the mobile view :frowning:

Hi Lee,

thanks for your reply.

I don’t think there’s a problem with this. Each element has its own unique name.

Hi Carlos,

thanks! I’m not sure about the difference (what to use), so I tried to copy the code back and forth. Something worked, something didn’t. Now I have everything in Page and they work 2/3 :))