my code stock.com

prometheus1981

Highlight navigation on hover
by prometheus1981

Snippet options

Download: Download snippet as highlight-navigation-on-hover.js.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

<script type="text/javascript">
		$(document).ready(function() {
			$page = "Home";
			$("li#1").css('background-color', '#2b469c');
			$("li.nav").hover(
				function () {
					$title = $(this).children("a").attr("title");
					if ($title != $page) {
						$(this).css('background-color', '#2b469c');
					}
				},
				function () {
					if ($title != $page) {
						$(this).css('background-color', '#04273d');
					}
				}
			);
		});
</script>

<div id="nav" class="">
					<ul>
						<li class="nav" id="1"><a href="#" title="Home">Home</a></li>
						<li class="nav" id="2"><a href="#" title="About Us">About Us</a></li>
						<li class="nav" id="3"><a href="#" title="Contact Us">Contact Us</a></li>
						<li class="nav" id="4"><a href="#" title="Manage Suscriptions">Manage Suscriptions</a></li>
						<li class="nav" id="5"><a href="#" title="Job Seekers">Job Seekers</a></li>
						<li class="nav" id="6"><a href="#" title="Advertise">Advertise</a></li>
						<li class="nav" id="7"><a href="#" title="Work Programs">Work Programs</a></li>
					</ul>
</div><!-- /nav -->

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.