I found the following snippet of javascript (uses jQuery) that would allow me to centre a menu/nav that is set to float:left. It seems to work in IE and Opera OK. But in FF and Safari, it works sometimes and other times trips out (keep refreshing the page and it will eventually work/fail). In Chrome it doesn't work at all.
Question
jordan.
I found the following snippet of javascript (uses jQuery) that would allow me to centre a menu/nav that is set to float:left. It seems to work in IE and Opera OK. But in FF and Safari, it works sometimes and other times trips out (keep refreshing the page and it will eventually work/fail). In Chrome it doesn't work at all.
Here is the code:
I don't know js so I can't figure out what the problem is. If anyone can help it would be much appreciated.
Here is the page running the code:
http://www.islandrobot.com/vanessa/
Cheers,
Jordan
Link to comment
https://www.neowin.net/forum/topic/894492-js-center-a-menu-that-is-floated-left/Share on other sites
15 answers to this question
Recommended Posts