Developing a drop down menu: Do I use javascript or pure css?
-
I am developing a drop down menu and am trying to decide if using javascript instead of just css is worth it.
I've done some research on the topic and the opinions seem dated. I know that at one time not using javascript for a drop down menu was important but now less so. Google constantly says that they will not discount the links just because they are not shown until javascript is ran.
What I want to know is has anyone discovered from testing that using javascript instead of css for a drop down makes a difference?
Note: the links will not be located in an external javascript file.
-
Hey Zachary!
It's a good idea to use pure css menus when the design and functionality are the same as using a menu with javascript AND the actual menu items are in a clean
html list (not delivered through the JS). But keep in mind that cross-browser functionality can be an issue with pure css menus. Internet Explorer is a real problem in this regard.
As for SEO, I doubt inline javascript that adds functionality to a clean html list will make search engines burp. We used to worry a lot about that like 5 years ago because JS used to cause slow load times, but nowadays the Internet is a lot faster, servers are faster, caching is better, etc... All the same, it's good coding practice to remove inline JS from HTML.
If you want something fast and cross-browser supported look for jquery menus. There are free samples all over the place and they are brilliantly fast and you can list your menu items in a plain html list (the important thing).
Happy coding... - P
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Google and responsive content in display:none CSS
I’m building a WordPress site with Visual Composer and I’ve hit a point where I need to show a totally different section on a mobile compared to a desktop/tablet. My issue/question comes from the fact that both mobile and desktop rows will have the same content as well as H1/H2/H3 tags. From inspecting the elements I see the mobile only rows are hidden until the page size shrinks through being set to 'display: none' in the CSS (standard visual composer way of handling width & responsiveness) How will Google see this in terms of SEO? I don’t want to come across as if I’m cloaking text and H1 tags on the page (I have emailed the visual composer support but wanted to get an external opinion)
Technical SEO | | shloy23-2945840 -
Should I Use Two Domains for Multi Language Sites?
I have an immigration attorney that wants a website in English and another in Spanish. We're going to have some of the website content from the English site translated via a translator to make it true, conversation spanish (automatic translators are good, but not perfect, and we want perfect). So my question is do you think we should use two different domains (englishsite.com, spanishsite.com), a subdomain (spanishsite.englishsite.com) or maybe just a separate section of the regular site (englishsite.com/spanishcontent)? My thought would be either a subdomain or a separate section so that we're not splitting PR.
Technical SEO | | atstickel120 -
My site has dropped in rankings what can i do to change this
My site is http://www.clairehegarty.co.uk/ Hi, my site has always done amazing in the rankings, for a few years i have been number one for the word gastric band hypnotherapy as well as many other keywords which includes hypno band. but in the past couple of weeks i have seen some of my keywords drop and end up on pages two and three of google instead of page one. Can anyone please give me advice on what i need to do to change this situation please
Technical SEO | | ClaireH-1848860 -
Too many links in header menu
I'm working on a few clients who are starting to get big header menus. Their site now easily exceeds the 100 links per page recommendation. Normally I would recommend them to cut down on the links, bit in this case these sites have menus that makes navigation easier. I honestly think these menus adds value for the users. The dilemma is that I think the menus provide value from an UX standpoint, but I'm not sure from the SEO standpoint. Any recommendations to this dilemma? Some examples: http://moodsofnorway.com/no/ http://www.gmax.no/ http://www.flust.no/
Technical SEO | | Inevo0 -
What keywords should i be using to promote my site
Hi i am looking to promote my home page which is a lifestyle magazine www.in2town.co.uk and i am not sure what keywords i should be using to promote it. I am doing ok for the keyword lifestyle magazine but i am struggling on what other keywords i should be using to get people to the home page of the magazine. The magazine is nearly finished and we still have a couple of finishing touches to do but the basics of the magazine is as follows holiday and travel news, soap gossip, celebrity gossip, product reviews, lingerie brands, gastric band hypnotherapy, health, fashion and beauty and holiday reviews. I want the home page to be the main page where everyone visits but i am not sure what i should be doing to accomplish this. Any ideas would be of a great help
Technical SEO | | ClaireH-1848860 -
Does CSS position effect the value of a link?
For example, take a look at http://www.dueds.com and scroll all the way to the bottom of the page. See the link in the bottom left? Does the fact that it is pushed all the way down to the bottom make the link worth less than if it was directly under the social media buttons?
Technical SEO | | adriandg0 -
Secondary Menu - nofollow or other strategy?
We have a "secondary main menu" on a site that displays some popular pages of the site. They are in the main navigation of the site as subpages but we wanted to highlight them on every page of the site through this secondary menu. so this secondary menu is the same on every page of the site. So we have the main menu on the top of the site, subpages on the left and this secondary menu below the subpages (in a blue box so they stand out). Is this secondary menu confusing for the structure of the site or negative at all (in relation to robots, not UX)? Should we nofollow these links in the secondary menu? thanks for replies!
Technical SEO | | Motava0