Ok this should be pretty simple so hopefully it will be simple to fix. I am
create a hover menu that make the li element under a certain id shoot out
15px whenever mouse it over them and back when it leaves.
here is a link:
http://apex-wowguild.com/dev/
If you try each one out by mousing over them they will react but in a random
way and not the way it should. here is my code:
jQuery.fn.hover_menu = function(offset, speed)
{
var self = this;
$(self).children('li').each(function()
{
//grab current margin
var current_margin = parseFloat($(this).css('margin-left'), 10);
var new_margin = parseFloat(current_margin + offset, 10);
$(this).bind('mouseover', function()
{
$(this).animate({paddingLeft: new_margin}, speed);
});
$(this).bind('mouseout', function()
{
$(this).animate({paddingLeft: current_margin}, speed);
});
});
}
is there anything wring with that code(i don't care about use mouseover()
instead of bind() because i did to test things)?
--
View this message in context:
http://www.nabble.com/What-is-wrong-with-this-code--tf4264306s15494.html#a12136013
Sent from the JQuery mailing list archive at Nabble.com.