- 0
Javascript multiple columns question
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
This mindblowing project lets you run Windows XP on the web
By Usama Jawad96,
- microsoft
- windows xp
- (and 4 more)
- 12 replies
- 0 views
-
Everyone seems powerless against Oracle's ownership of the JavaScript trademark 1 2
By Usama Jawad96,
- oracle
- javascript
- (and 5 more)
- 29 replies
- 0 views
-
HTML, CSS, & JavaScript All-in-One For Dummies (worth $39.99) free download ends today
By News Staff,
- ebook offer
- sponsored
- (and 3 more)
- 0 replies
- 0 views
-
Download HTML, CSS, & JavaScript All-in-One For Dummies ($39.99 Value, now FREE)
By News Staff,
- ebook offer
- sponsored
- (and 5 more)
- 0 replies
- 0 views
-
WordPress-Theme Twenty Twenty Four-customizing: how to do that - a Gutenberg special question...
By thedhubs,
- 1 answer
- 1,756 views
-
Question
M_Lyons10
Good afternoon everyone!
I am NOT strong with javascript at all, and was trying to do something today and having no luck whatsoever.
I have drop down menus from the navigation on my site and one of them is getting too long (on desktop). I wanted to, if the nav ul has more than 8 items in the list for it to show as two separate columns.
Here is the javascript from the navigation now:
$('#nav > ul').dropotron({
offsetY: -16,
mode: 'fade',
noOpenerFade: true,
hideDelay: 400
});
I would assume that this would need to be done in the javascript since I attempted to edit the css and that did not work. Just for clarity, here is the CSS:
#nav {
position: absolute;
right: 2.5em;
top: 0; }
#nav ul li {
float: left;
margin-left: 1.5em;
height: 7em;
line-height: 7em; }
#nav ul li a {
color: #fff;
-moz-transition: background-color .25s ease-in-out;
-webkit-transition: background-color .25s ease-in-out;
-ms-transition: background-color .25s ease-in-out;
transition: background-color .25s ease-in-out;
color: #ccc;
text-decoration: none;
text-transform: uppercase;
font-weight: 700;
padding: 0.55em 1.4em 0.55em 1.4em;
border-radius: 6px;
outline: 0; }
#nav ul li a:hover {
color: #fff; }
#nav ul li.current_page_item a, #nav ul li.active a {
background: #20242A;
color: #fff; }
#nav > ul > li > ul {
display: none; }
I'm open to suggestions as well. I'm just trying to have the menu be a little easier to navigate.
Thank you for your help!
Link to comment
https://www.neowin.net/forum/topic/1385711-javascript-multiple-columns-question/Share on other sites
4 answers to this question
Recommended Posts