I have a new navigation bar at the top of my home page: acesinaction.com/home
(I currently have the main homepage under construction while I fix this).
My question is that it only works on the HomePage, not any others. I wrote my code in the "Site Code" Tab and even transferred it to the "Home Page Code" Tab of the Home page. However, I cannot get the drop down navigation containers to appear on any other pages.
Please help!! I'm sure I'm overlooking something simple... Thanks in advance! Craig
Here's my code:
import wixWindow from 'wix-window';
export function button95_mouseIn(event, $w) {
$w('#box2').show();
}
export function button95_mouseOut(event, $w) {
$w('#box2').hide();
}
export function button96_mouseIn(event, $w) {
$w('#box4').show();
}
export function button96_mouseOut(event, $w) {
$w('#box4').hide();
}
export function button97_mouseIn(event, $w) {
$w('#box6').show();
}
export function button97_mouseOut(event, $w) {
$w('#box6').hide();
}
export function button98_mouseIn(event, $w) {
$w('#box8').show();
}
export function button98_mouseOut(event, $w) {
$w('#box8').hide();
}
export function button99_mouseIn_1(event, $w) {
$w('#box10').show();
}
export function button99_mouseOut_1(event, $w) {
$w('#box10').hide();
//This code keeps the Nav Menus from disappering before you can hover them
}
export function box2_mouseIn(event, $w) {
$w('#box2').show();
}
export function box2_mouseOut(event, $w) {
$w('#box2').hide();
}
export function box4_mouseIn(event, $w) {
$w('#box4').show();
}
export function box4_mouseOut(event, $w) {
$w('#box4').hide();
}
export function box6_mouseIn(event, $w) {
$w('#box6').show();
}
export function box6_mouseOut(event, $w) {
$w('#box6').hide();
}
export function box8_mouseIn(event, $w) {
$w('#box8').show();
}
export function box8_mouseOut(event, $w) {
$w('#box8').hide();
}
export function box10_mouseIn(event, $w) {
$w('#box10').show();
}
export function box10_mouseOut(event, $w) {
$w('#box10').hide();
}
Hi!
Few things that might help you shed some light on the way to solve this issue:
1. You cant have more than one 'onReady' function in a single page. Having more than one will cause the functions to run over each other.
2. You cant apply both Data Binding (connect to dataset / link to a page / etc.) and code on the same component (your buttons in this case). It will cause a malfunction and both actions won't be executed.
3. Writing the code for the navigation buttons in the site code is the correct way. But in order for them to work you need to place them in a global area (that appears in your entire site) such as the header and the footer of the page.
4. Read about and use the wixLocation API.
Hope it helps.
Best of luck!
Doron. :)
I realized that other pages are showing errors on the 'box' elements because they're only on the homepage (not included on the other pages). So the question is, is there a way to call those boxes WITHOUT having to copy and paste them on every page of the website? Thanks!!