Wix strip - button performance

Hi all, is it possible at all via coding, to have an image strip, that users can click on which directs them to a page within the website?

$w(“#YOURSTRIPID”).onClick(()=>{
wixLocation.to(“/page”)
})

Of course, you need to import wixLocation

Thanks, so for the wixLocation, how do I write the intended page? If that makes sense?

For example, if its linking to ‘About Us’, do I literally write ‘aboutus’?

Check your page setting (there should be a place where you can edit the slug)

https://www.YOURDOMAIN.com/MYPAGESLUG

then put “/MYPAGESLUG” inside the () of wix location to

1 Like

@certified-code Thanks again. So i’ve just done that, but I am getting a red underscore on the word ‘wild’ within the slug. But i’ve copied it from the settings panel

$w(WildLifeStrip1).onClick(()=>{ 
wixLocation.to(/wild-life-photography) 
}) 

});

Is there an error? It says theres an ‘unterminated regular expression’

Appreciate your help

1 Like

(“/XXXXXXXXXXX”)

ADD THE “”

And $w(“#XXXXXXX”)

Hashtag needed to select a element

1 Like

@certified-code Do I need to end the coding with });, or can it be })

Its still not happy with the ending

});

@certified-code Thought so! Somethings wrong with it

Remove the code on line 6

$w.onReady( function() {
//PUT ALL YOUR CODE INSIDE HERE
});

Like so? The image is being recongised, as the cursor changes to a hand emoji, to signify a clicking action.

Sorry about this, thanks for your patience

Remove the //

If i do that, it underlines the }); on the bottom line

Screenshot

Or post the whole code

@certified-code

$w.onReady( function (){
$w( “#WildLifeStrip1” ).onClick(()=>{wixLocation.to( “/wild-life-photography” )
});