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
-
The use of Markup language
Hi, We were thinking of adding markup language to our site. We have been reading about it to understand the actual benefits of doing so (we have seen many brands are not using it, including moz.com). So I have two questions: 1- Would you recommend using it for our site? www.memoq.com 2- If yes, would it be better to create a snippet of code for our home page as an "organization" and then different snippets for our product pages as "products". Looking forward to your comments,
Technical SEO | | Kilgray0 -
Pagespeed drop on https
Hi all, Since I have moved from http to https my pagespeed has dropped. My hosting company/ programmer say this is normal but I am not happy with the results. Before: mobile 69 desktop 89 Now: Mobile: 52 desktop 69 Anybody experience with this issue? All help is welcome! Thank You in advance Tymen
Technical SEO | | Tymen0 -
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 -
IP address changed and some rankings drop
I changed my hosting company coz better server hardware and results (google). My website was perfectly for every queries on google but after changing company and ip address some results dropped to second page. What can i do now? These drops caused by changing ip address?
Technical SEO | | umutege0 -
Does anyone use paid seo tools
Hi, i see a lot of people claiming that paid seo tools work, i would like to know if anyone uses them. I have a new site that i am building and i am wondering if there are any good paid tools out there that could help me gain exposure quicker. I get a lot of emails from well known companies promoting their paid tools but have never bought any as i believe you should hear from people who have tried them first. If you feel there are any good paid seo tools out there for help with rankings and link building then i would love to hear about them
Technical SEO | | ClaireH-1848860 -
What caused my huge drop in search ranking?
On February 8th, 2012 my site's non-branded search traffic dropped overnight by over 80%. It appears I've been hit by a Google penalty. I submitted a reconsideration request and one of Google's staff replied letting me know it was NOT a manual penalty. So it's clearly a result of an algorithm. What is the cause? I haven't made significant changes to the website in the previous months do to being out of the country and the holidays. I'm extremely careful not to out source SEO so there is no chance of questionable link building strategies, unless my competitor launched an attack on my site. I've considered these possible causes: Duplicate content - My site had some redundancy from a marketing plan before Google Panda launched. Last month, I removed all duplicate content. Unnatural link building - I've been moving slowly my site, page by page, from adbio.com to bioworldusa.com after a brand change. Perhaps the 301 redirects triggered a flag in Google's algorithm. I've since removed all redirects to see if that will fix the issue. Poor User Experience - I recently upgraded my Drupal CMS and had to change themes. Currently my theme is an ugly, grey theme which may cause a higher than usual bounce rate. I've been trying to compensate by making sure the content is high quality. The penalty affected these website: www.bioworldusa.com (2/8/12) blog.bioworldusa.com (2/8/12) www.adbio.com (2/17/12)
Technical SEO | | bioworld1 -
Javascript usage
Hi Guys, I know that since a couple years Google can crawl and read better Javascript(JS), but JS can still harm your website especially in the navigational bar but I don't know how to identify it. Can Someone tell me how to identify in the source page when JS can harm your website?
Technical SEO | | Ideas-Money-Art0