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
-
Using a 302 redirect for language variants. How should I use the canonical?
Hi there, I have a question regarding the canonical tag. The current setup is like so... www.site.com 302 redirects to.. www.site.com/de/ I want to add canonical tags on every page to avoid duplicate content but I'm not sure about the homepage. Should the canonical URL be www.site.com or www.site.com/de/ ? I'm concerned that I could be about to hurt my ranking. Thanks,
Technical SEO | | zuriwolf
Mitch0 -
Create Page Titles from H1 using Yoast?
I'm working on a site that has 280 blog posts that have either been migrated from an old CMS site or created on the Dev version of the new WordPress site. We've written 280 unique meta descriptions so they don't truncate but it there a quick way I can export the current H1s and then import them into Yoast so they are set as the Page Titles? I've written unique Page Titles and meta descriptions for all the Service and Products page and just want a way to speed up the blog posts as their H1s are really good and what I would use as Page Titles anyway. Any help, greatly appreciated!
Technical SEO | | Marketing_Today0 -
Web Page Dropped Out of Google?
One of our web pages seems to have completely dropped out of Google after featuring on page 1 for a number of years. It can't be a site wide issue as all other web pages are performing as normal. The page is http://www.contractormoney.com/income-protection/ and the key phrase it was performing well for was 'contractor income protection'. Any ideas??
Technical SEO | | Pete40 -
Using a single sitemap for multiple domains
We have a possible duplicate content issue based on the fact that we have a number of websites run from the same code base across .com / .co.uk / .nl / .fr / .de and so on. We want to update our sitemaps alongside using the href lang tags to ensure Google knows we've got different versions of essentially the same page to serve different markets. Google has written an article on tackling this:https://support.google.com/webmasters/answer/75712?hl=en but my question remains whether having a single sitemap accessible from all the international domains is the best approach here or whether we should have individual sitemaps for each domain.
Technical SEO | | jon_marine0 -
Traffic drop 98% in two days
I changed my theme on April 12th and within 24 hours my traffic plummeted 98%. I have also seen a huge difference in my keyword ranking. A few things have been tweaked, but with no results. I need to get to the bottom of this fairly quickly. Do you have any recommendations of a trustworthy someone I could hire to dig deeper and find out what the %#^!$@ is going on? I didn't see that SEOmoz does the "hire and let us check it" thing. Of course, if anyone has any free suggestions...I'm open to those as well. 🙂 Thanks Heather
Technical SEO | | Gotmoxie0 -
Content development for improving organic SEO Questions
I have a real estate web site at www.nhfinehomes.com. The site is build on a Windows Server running ASP.NET with a basic, home grown CMS. In my Google Analytic under Traffic Sources, Search Engine Optimization, Queries I see a list of over 1,000 keyword phrases that my site had ranked for. In an effort to improve these rankings, I am under the assumption that if I create original content for these terms and add it to my site, it could help improve ranks? First question, is this a valid strategy worth pursuing assuming the content is good, I use good internal linking practices and make sure not to 'orphan' these pages? Second, because my current site technology doesn't really make it easy to add content, I have figured out how to install a WordPress blog at www.nhfinehomes.com/blog (currently not up since the MySQL DB died for some reason) So am I at any disadvantage adding all this content to /blog vs. right on the primary CMS? Obviously the WordPress template is not the same as the main pages so primary nav and footer nav differ. Of course I can cross link between the two but wanted to make sure this was not going to penalize the value of this content. Third, if there is anyone with Windows/.NET optimization experience at the server and site architecture level and can help me give my site a once over, I would be most appreciative. I'm not the programmer and rely and a friend to help with that and his SEO experience is very limited. Thanks in advance.
Technical SEO | | LinkMoser0 -
Huge drop for main branded keyword
The past week the main branded keyword for a site i am working on has dropped from the top three on Google US to page 7! It is still ranking in the top three on Google in other areas. I recently redirected /index.php to / using .htaccess. Could this have caused a problem? If not, what else could have caused such a huge drop?
Technical SEO | | Tedred0 -
Limit number of links in a page, how to build the menu?
Hi, One of the first SEOMoz tool recommand to me, is to avoid multiple links on the same page. This is fully true, i've more than 600 internal links placed in a menu on the header.
Technical SEO | | vdgvince
This means that each page contains these 600 links at least. User-experience wise, i need to keep this multi-level menu accessible. What would you suggest me ? => No-follow on the links would be useful and not penalizing (if i still have other do-follow links to these pages) => Javascript menu, so that i can't be crawled by google => Any other suggestion? Thank you in advance!0