1 Replies - 959 Views - Last Post: 05 June 2011 - 03:17 PM

#1 witchest   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 05-June 11

accordion-menu -> not functional if mouse comes from the top

Posted 05 June 2011 - 10:19 AM

Hello!

Here is my menu

I'm totally new in jQuery. The accordion-menu I created works nice if the mouse comes from the bottom, but if the mouse comes from the top, it isn't functional.

Do you know a trick to let the mouseover stay, while the mouse comes from the top?

Many thanx!


function Accordion() {
  $('.accordion ul').hide(); // hide all unordered lists inside the accordion list
  //$('.accordion ul:first').show(); //show the first unordered list inside the accordion

  $('.accordion li a').mouseover(
	  function() {
		    var checkElement = $(this).next();
			if((checkElement.is('ul')) && (checkElement.is(':visible'))) { 
				//list is opened...
				return false; // -> stay visible
			}
			if((checkElement.is('ul')) && (!checkElement.is(':visible'))) { 
				//list is closed...
				$(this).next().slideToggle('slow'); // -> open invisible (slideDown)
				return false;
			}
		}
  );
}
$(document).ready(function() {Accordion();}); //when the document is ready to load "is" the script iniciates the function



Is This A Good Question/Topic? 0
  • +

Replies To: accordion-menu -> not functional if mouse comes from the top

#2 japanir   User is offline

  • jaVanir
  • member icon

Reputation: 1014
  • View blog
  • Posts: 3,025
  • Joined: 20-August 09

Re: accordion-menu -> not functional if mouse comes from the top

Posted 05 June 2011 - 03:17 PM

I tried it on chrome firefox and IE9. works perfect. What browser do you use?
Does the problem occurs when this is a part of full code, or you have that problem in the link you posted as well?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1