1. Home
  2. Computing & Technology
  3. JavaScript

Enhanced Suckerfish Menu

4. Javascript

Join the Discussion

Questions? Comments?

More of this Feature

Introduction HTML CSS

The final step in creating your enhanced suckerfish menu is to install the Javascript that will make the menu functional in Internet Explorer 6 and earlier (which don't support hover references and position:fixed in CSS).

Simply copy the following code and save it as sfmenu.js.

The final step is to link the Javascript into your web page by adding the following to the head of your page. Note that the code is surrounded within a comment as far as browsers other than IE are concerned. Internet Explorer recognises this code as a conditional (if) statement telling the browser to include the script in versions of Internet Explorer prior to version 7.

<!--[if lt IE7]>
<script type="text/javascript" src="sfmenu.js">
</script>
<[endif]-->

You now have a menu that will allow people to navigate around your site regardless of whether CSS and Javascript are supported or enabled but which will offer advanced functionality when they are.

Explore JavaScript
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.