[jQuery] What is wrong with this code?

2007-08-13 Thread Eridius


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.



[jQuery] What is wrong with this code

2007-04-20 Thread joomlafreak

Hi
this is what I have

jQuery.get(item_link,function(item_content){

var new_content =
jQuery(item_content).filter(#contentpane .contentpane  p).eq(0);

jQuery(#myContent).html(new_content).slideDown(slow);
});

What I imagine this code should be doing is extract the first
paragraph from the item_content and fill the #mycontent with this
first paragraph.

But what I get it nothing in this #mycontent.

Can someone please point me to what I am I doing wrong. I intent to
extract the first paragraph from
#contentpane .contentpane element.

thanks