troubleshooting Question

Make default dropped down - menu

Avatar of movieprodw
movieprodw asked on
8 Comments1 Solution378 ViewsLast Modified:

I have the below code for my nav menus and I was wondering if I could make on of the drop downs, down, by default.

I would like nav-1 dropped down until nav-3 is hovered over.


<script type="text/javascript">
	var $j = jQuery.noConflict();
		 var config = {    
			 over: showSub, // function = onMouseOver callback (REQUIRED)    
			 timeout: 500, // number = milliseconds delay before onMouseOut    
			 out: hideSub // function = onMouseOut callback (REQUIRED)    
		buildSub('.nav-1', 0);
		buildSub('.nav-3', -138);
		$('#nav li .sub .nav ul').show();
		//$j(".nav-2 .sub").show(); 
		$('#nav li').hoverIntent(config);
		function buildSub(name, offset) {
			var list = $j(name).find("ul").text();
			if (list.length > 0) {
				list = '<div class="nav"><ul>' + $j(name).find("ul").html() + '</ul></div>';
			} else {
				list = '';
			var content = $j('.na-' + name.substring(1) ).html();
			var sub = '<div id="nav-1" class="sub">' + list + '</div>';
			$j(name + ' .sub').attr('id', name.substring(1));
			$j(name + ' .sub').css('left', offset + 'px');
		function showSub(){ 
		function hideSub(){ $j(this).find(".sub").slideUp(); }
<script type="text/javascript">
function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros