Trying to make pages menu sticky - javascript trouble?
Hey all,
I'm trying to make the pages menu on the site I'm working on stick to the top of the page when the user scrolls down, following the tutorial here: http://www.dwuser.com/education/cont...vigation-menu/ I've followed the steps, making the (what I thought were) necessary tweaks to the javascript for ata. Here is the javascript: Code:
$(function() { I changed Code:
var nav = $('#nav'); Neither is working. I know next to nothing about javascript or jquery (it's on my todo list), so any help with this would be greatly appreciated. Link to site: http://www.laurenacooper.com/ohprefresh |
why not put the menu at the top to start and fix it with css?
HTML Code:
div#menu1 {position: fixed !important; top: 0 !important;} |
Because we want the menu bar to be beneath the logo, and only stick to the top of the page as the user scrolls down.
|
You should contact the author of the code and ask them for advice
|
Ok, fair enough. Can you please tell me though if I am putting the code in the right place? HTML inserts > head? Or would I need to put it in a theme file somewhere?
|
That seems like the logical place, but I didn't read their documentation so I can't be 100% sure. but it should go somewhere in the 'Add HTML/CSS Inserts' options and not in a theme file.
|
Thanks JD. Appreciate ya :)
|
Here is a menu plugin that doesn't do exactly as you want but... When you scroll down a defined distance a copy of your menu appears stuck to the top. You can see an example at the link.
|
All times are GMT -6. The time now is 11:50 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.