JQuery WordPress Menu Help in Animation

Asked By 40 points N/A Posted on -
qa-featured

Hi,

I have below a JScript that supposed to have an animation in the submenu when I hover my mouse in it. But I just can't seem to get it done. Please have a look at this code:

$("ul li").hover(function() {
	if($(this).find('.sub-menu')){
		$('.sub-menu').animate({marginLeft:'-30px'}, 200);
	} else {
		$('.sub-menu').animate({marginLeft:'0px'}, 200);
	}
});

What can I do to solve this problem?

 

SHARE
Answered By 0 points N/A #107173

JQuery WordPress Menu Help in Animation

qa-featured

 

You can have a look at the following technique, which can helps you to find out the problems:

–          Always use window.setlnterval for animation.

–          Do not use global variable.

–          Animation always passes through to animation function as an object not with its ID.

–          The newly initiated animation can be replaced the terminated animation.

–          Always use the animation in a easy way.

–          Between a given parameter it initiates a simple function to produce easy in and easy out motion.

–          User can use multiple variable at a fixed animation, the multiple parameter are used by the fades (RGB).

Login/Register to Answer

Related Questions