function - How to stop a jQuery effect on a menu item with the class of .curent? -



function - How to stop a jQuery effect on a menu item with the class of .curent? -

i have list of blog categories in sidebar right of page.

i have set-up jquery effect when hover on category name animates 5px padding left.

everything working well, if click on category, want bring category page same category sidebar list, current category having class of .current.

i current category have 5px padding left , have no effect when hovered over.

basically create stand out other categories in list.

here jquery have atm:

// blog categories animation $(function() { $('#blog-categories ul li a').hover( function(){ $(this).find('img').animate({paddingleft: '+=5'}, 100); }, function(){ $(this).find('img').animate({paddingleft: '-=5'}, 100); } ); });

if knows way have 5px added padding nowadays on current category item.

ie '#blog-categories ul li a.current'

and have no farther animation when hovered over, great!

i hope have explained myself ok here :)

here's screenshot of on .current category item:

try using .not() method

$(function() { $('#blog-categories ul li a').hover( function(){ $(this).not('.current').find('img').animate({paddingleft: '+=5'}, 100); }, function(){ $(this).not('.current').find('img').animate({paddingleft: '-=5'}, 100); } ); });

to have 5px padding present, why not add together .current class?

jquery function jquery-animate

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -