jQuery LavaLamp default element tests

protocol: | port: | host: | hostname:

href: | pathname:

hash: | search:

LavaLamp's order of precedence for starting hover location:
  1. startItem
  2. class="selected Lava"
  3. home element and returnHome is true
  4. location match with contained URI
  5. first element in list

1. startItem test

$('ul#manualtest').lavaLamp({startItem: 3});

2. selectedLava (& noLava) class tests

<li class="selectedLava"><a href="/projects/lavalamp/urltest/">trailing slash</a></li>

3. home element test

$('ul#hometest').lavaLamp({homeTop:100, homeLeft:100, returnHome:true});

URL Combination tests

Important note about relative links: Relative anchor links, eg. <a href="folder/file.html"> is notorious for causing many problems with production web sites, especially when redirecting relocated content. In recent years this practice has been strongly discouraged in favor of absolute linking. LavaLamp does its best to correctly match the a href tag inside your menu with the current page location information available within Javascript. However, for best results use absolute path links in your LavaLamp menu: eg. <a href="/folder/file.html"> The forward slash at the beginning of the href link is what defines an absolute path.

download LavaLamp for jQuery

copyright (c) 2008, 2009 Jolyon Terwilliger / Nixbox Web Designs

feel free to reuse this code anyway you see fit in your own projects, understanding that you assume all responsibility upon usage.