-3

I was trying to get this working, found here: Horizontal scrolling div using buttons

But i was getting a error; unexpected token in my code, i can't figure out what i'm missing.

      $('#left-button').click(function {
         $('#productcontainer').animate(
           marginLeft: +="200px"
           , "fast");
      });

Thanks for the heads up!

Community
  • 1
  • 1
Loed
  • 404
  • 7
  • 18

2 Answers2

0

Try fixing your code like this:

JQUERY

$('#left-button').click(function() {
    $('#productcontainer').animate({
        marginLeft : "+=200px"
    }, "fast");
});

Note the adjustments on your code!

check this Fiddle!

Zuul
  • 16,217
  • 6
  • 61
  • 88
0

If you look at what you linked to, you will see that you are missing the {} for the animate method.

.animate({ parma1, param2, etc })
Alfred
  • 21,058
  • 61
  • 167
  • 249
cdre
  • 11
  • 2