1

I've looked around through the jQuery docs and google and I can't seem to figure this out, though I have a feeling it's probably something really obvious I'm missing. For some reason, I get this error,

Uncaught SyntaxError: Unexpected token -

,everytime I try and execute my script and I have no idea why (I've tried the script with and without the two - negative signs but it doesn't make a difference).

Here's my code:

$('.head').hover(function() { $(this).stop().animate({text-indent:'-60px'},100); }, function() { $(this).stop().animate({text-indent:'-50px'},200); }); 
2
  • 2
    You probably need to either quote text-indent ('text-indent') or use camel case (textIndent). Commented Mar 26, 2012 at 23:08
  • 1
    @jo8691 thanks, can't believe I overlooked that. Anyways, next time post the answer as an actual answer (instead of a comment) so I can mark it down as an answer (and give you credit) Commented Mar 26, 2012 at 23:17

1 Answer 1

4

Try:

$('.head').hover(function() { $(this).stop().animate({'text-indent':'-60px'},100); }, function() { $(this).stop().animate({'text-indent':'-50px'},200); }); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.