0

I'm trying to get this to ease when it moves, but it doesn't seem to work..

$('#aboutlnk').hover(function(){
    $('#navul').animate({
    left: '753px',
    width:'75px'
    }, {
    duration: 300,
    easing:'easeOut'
    });
});

Also, how do I stop the code from running over and over again, for example if I hover over the same thing 100 times it will keep replaying 100 times...! Thanks!

Matt
  • 5,005
  • 10
  • 32
  • 39

2 Answers2

2

The easing you specify is not available by default with jquery. Try linear/swing

easing:'swing'

or...

easing:'linear'

Alternatively, you can use an easings plugin to have access to many more easings. Here is a good one... http://gsgd.co.uk/sandbox/jquery/easing/

Billy Moon
  • 57,113
  • 24
  • 136
  • 237
0

First off, the easy one - to stop the animation from queueing all the time, add in a call to .stop():

$('#navul').stop().animate({

As for the easing, do you definitely have the jQuery UI library loaded as well as jQuery itself? Only "swing" and "linear" easing is available natively, and you need to load in the UI to get the more exotic effects.

Joe
  • 15,669
  • 4
  • 48
  • 83
  • I've got ...unless another library is needed... – Matt Oct 11 '12 at 22:58
  • Yes, that's just the jQuery library, so you can only use "swing" and "linear" easing. You'll also need to pull in `http://code.jquery.com/jquery-1.8.2.js` in order to get access to "easeOut" – Joe Oct 11 '12 at 23:01