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
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 -
Use keywords that has another keyword in it for another link
Hi, I have these two links: A1 & A2 and the keywords for them are these: Pest control for A1 Pest control service for A2 is google smart enough to differentiate these two & rank the exact page for them accordingly? or does google guess pest control keyword in A2 link as well? please help me with this issue. & the same with these : termite inspection & termite inspections Arizona!! many thanks Shervin
Technical SEO | | Shervin0 -
Use 302 redirect when site crashes
My company has switched to a new ecommerce platform that we are not totally familiar with yet. As we've worked with it, we've had a couple situations where both the front and back ends of our site crashed simultaneously (always after installing a third party module). The platform's built-in backup solution hasn't been an option in those situations so we've been coming up with alternatives. We now have a duplicate of the site on our server for such emergencies. The plan is to have pages on the broken site point to the backup site using 302 redirects until the broken site is fixed. Is this correct usage of the 302 redirect? I often see people recommend to never use 302 redirects, but I thought this might be the kind of situation where they'd be appropriate. If so, are there other SEO considerations we should keep in mind? For example, I'm wondering if we should put canonical tags on the temporary site that point to the broken site so the broken site stays in the SE indexes.
Technical SEO | | Kyle_M1 -
June 7th, 2013 Structured Data Drop
On June 7th, 2013 our structured data (as reported in GWT) dropped from ~61M items on ~7M pages to ~13.5M items on ~1.5M pages. Since that time those numbers have continued to fall. We made no code changes during this time. I've searched around the web and found a few people pointing to a similar June 7th, 2013 drop in reported structured data. Can anyone offer any insight beyond speculation? Outside of the June 7th date, what can cause such a dramatic drop in structured data? Thanks in advance.
Technical SEO | | RyanOD0 -
Rankings drop after Panda
Hi All, My site dropped completely out of the SERPS on September 27th. I've tried everything I know to do (re-wrote all content, disavow links tool, filed DCMA complaints, de-optimized on-page content, made anchor text less aggressive, etc). Can you all please take a look at www.doctorloanusa.com and let me know what you think the problem is and how much you'd charge to help? Keywords used to be: doctor loans, physician loans. I ranked 2 or 3 for those keywords consistently for over 4 years. I know I need more content, but I feel like it's a waste of time creating it. If a thin site was the issue, wouldn't I at least rank SOMEWHERE in the 1000 results? Thanks for your consideration. At my wits end.
Technical SEO | | Cary_Forest0 -
My site has dropped three places in one day i do not understand it
Hi our site has always been either number one in google or at the bad times number two for the search word gastric band hypnotherapy but today we have dropped three places and we do not understand what has happened Can anyone please have a look and see what we need to do to get back on top. the site that is above us does not have much information on the subject so we are very puzzled here is our site www.clairehegarty.co.uk/virtual-gastric-band-with-hypnotherapy many thanks
Technical SEO | | ClaireH-1848860 -
Drop down menu
Does the first anchor text link rule ( the first link is given weight ) applies to links in the body of the content only. If there are links in the drop down menu, and in the body of the content, does the above rule applies to links in the drop down menu.
Technical SEO | | seoug_20050 -
Is using a Href in Div OK?
Hi, I was just wondering what your thoughts are on using a Href in a Div, which contains anchor text. We currently use the Href on the div, as opposed to just the anchor text as I want the whole div to be clickable as opposed to just the anchor text. So currently I have: Keword 1
Technical SEO | | James77
Keyword 2 Is this perfectly fine to do it like this as opposed to using <a tags="" ???<br="">I suppose there are various alternatives - if you must use the</a><a tag="" like:<="" p=""></a> <a tag="" like:<="" p=""></a> Keword 1
Keyword 2 However I would assume a search engine is smart enought to know its the same thing??? Thanks0