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
-
Use 301 or rel=canonical
I have a page on my site that is showing in search results at #9. I created another page on my site with the search term in the url. Wondering if I 301 or rel=canonical. Thank you, Kerry
Technical SEO | | Hydraulicgirl0 -
Ranking Drop and Google Disavow Requests
My website, www.nile-cruises-4u.co.uk has fallen dramatically for the top industry search terms (nile cruise, nile cruises) over the last 12 months from previous page one rankings to page three which has very badly affected us financially. I found, using Linkdetox, that we had thousands of back-links for non-related anchor-text, mainly porn terms, viagra, etc. I have submitted a Disavow file and request about a week ago and wondered firstly if the enormous amount of these links would have helped cause the drop to page three and secondly if the Disavow request will eventually help the website return to better rankings? Thanks,Colin
Technical SEO | | GratefulFred0 -
Has anyone used prbuzz.com for pr distribution?
Has anyone used prbuzz.com for pr distribution in an effort to boost SEO? I am attracted to their unlimited distribution for 1 price for the year. Does anyone have an opinion and or suggestion of another company. Thanks!
Technical SEO | | entourage2120 -
Does Google Read Javascript?
I would like to include a list of links in a select type box which I would like google to follow. In order to do this, I will be styling it with the help of javascript, and in turn change the select box into a ul and the options into li's. The li's would each contain a link, but if javascript is disabled it will fallback to a normal css styled select box. My question is would google follow the links made by the javascript? Or would the bot just recognize the select box as a select box and not links. Thanks for any help!
Technical SEO | | BrianJenkins0 -
"Spam emails" : ranking drop?
Hello, Is it possible that a website gets penalised by Google because your hosting company blocked you from sending emails? Basically I got a message from my hosting company saying that they were blocking me from sending emails from our server and domain because too many had mistakes or were complained about. The same day we dropped from 2<sup>nd</sup> on a keyword to about 600<sup>th</sup> while still being ranked for other keywords. The drop was for our main keyword. Can the fact we sent “bad emails” be related to a rank drop? For the record, those were confiormation emails for account creation, they were legit, not spam. That's off-topic though.
Technical SEO | | EndeR-0 -
Why did our site drop in Google rankings?
My site's URL (web address) is: http://tinyurl.com/3svn2l9 Hi there, We operate a travel site that lists numerous tours, accommodation and activities. Since 6th August 2011 we have dropped from top 10 SERP rankings of our pages to around result number 100 (page 10) and losing massive amount of visitors via Google Search. Our Yahoo and Bing rankings are still in the top10. We need your advice and quick! The last changes we have made are the following: -redirected the non-www version to the www version on the 1st August -bought advertising with a follow link in a sidebar that is being populated across the site (+4000 pages) about 2 months ago -added a blog to the website 2 weeks ago and posted 2 posts to date. Additionally, our website structure allows visitors (and bots) to see the same listings via different URLs which caused duplicate content. This has been the case since the launch of our website about 1 year ago. To prevent this duplicate content we have placed canonical tags on the individual listings pages. Why did our site all of a sudden plummet in the rankings?
Technical SEO | | Robbern0 -
How does a mega drop-down affects SEO?
We are looking at implementing a "mega drop-down" as our main menu on our website. Will that be good or bad for SEO? My company is a big tour operator so our website contains a lot of pages describing all our destinations, hotels etc. We have noticed that our visitors have some trouble to navigate to all this pages since it requires a lot of clicks to reach a specific page. In order to make this easier we have looked at this popular mega drop-down thing that we all love. But what about Google? Will Google love or hate us for doing this? An example showing what I mean by mega drop-down: http://www.phonehouse.se/
Technical SEO | | Googleankan0 -
What are the SEO implications of using Interstitials?
Hi, I want to implement an interstitial similar to http://timesofindia.indiatimes.com/defaultinterstitial.cms. Within few seconds it gets redirected to http://timesofindia.indiatimes.com/. What are the SEO implications of having this sort of arrangement? Regards
Technical SEO | | IM_Learner0