Hi, trying to fire 2 functions on a single onclick event :
- hide a box
- navigate to another local page
I tried the following code, it navigates to the other page, but does not hide the box.
P.S.All this trouble because the lightbox wouldn’t fire up quickly. #notacoder
import wixLocation from ‘wix-location’
export function text194_click(event) {
wixLocation.to( “/home” )
.then(() => {
$w( ‘#box22’ ).hide();
})
}
Hi Virendra,
What page is your box on, the page you are leaving or the home page? If it’s on the leaving page is to be hidden when navigating back to that page again?
Background: Buttons are placed on the header which act as a menu bar. On clicking the button, a box appears which has the list of solutions we provide. When somebody clicks on the one of the solutions(text format) which is in the box, I want the code to close the box and navigate to the respective page .
Thank you.
Try this →
exportfunction text194_click(event) {
$w('#box22').hide();
wixLocation.to("/home")
}
Do we now have 2xKumar here?
Yay, Ajit thank you so much, it works !!
@russian-dima haha, did you bring your blow gun…