/    Sign up×
Community /Pin to ProfileBookmark

Floating Navigation

I have Javascript side navigation with dropdown sub-menus.

Being a newbie, could anyone please help by editing the position code below so that when a page is scrolled down the navigation will float down to it’s same position

This is the code I have with the menu disappearing when page is scrolled.

/*
— menu level scope setting structure —
*
/
var MENU_POS = [
{
// item sizes
‘height’: 25,
‘width’: 140,
// menu block offset from the origin:
// for root level origin is upper left corner of the page
// for other levels origin is upper left corner of parent item
‘block_top’: 15,
‘block_left’: 300,
// offsets between items of the same level
‘top’: 24,
‘left’: 0,
// time in milliseconds before menu is hidden after cursor has gone out
// of any items
‘hide_delay’: 200,
‘css’ : {
‘outer’ : [‘m0l0oout’, ‘m0l0oover’],
‘inner’ : [‘m0l0iout’, ‘m0l0iover’]
}
},
{
‘width’: 120,
‘block_left’: 30,
‘css’ : {
‘outer’ : [‘m0l1oout’, ‘m0l1oover’],
‘inner’ : [‘m0l1iout’, ‘m0l1iover’]
}
}
];

All help much appreciated

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @charter spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...