JavaScript Moving a div with animation moving animations,moving animations for powerpoint free download,moving animations

I'm looking to move a div "#menu" to the side when it's clicked on. I'm using this code

  <script>
    $("#menu").click(function(){
        $("this").animate({ 
            marginLeft: "+=250px",
        }, 1000 );
    });
    </script> 

but it doesnt seem to do anything, I dont even get a cursor when I hover over it. What am I doing wrong here? I'm sure this is a simple fix that I'm just overlooking.

Answer:1

You should use $(this) (without quotes).

$("#menu").click(function(){
  $(this).animate({ 
    marginLeft: "+=250px",
  }, 1000 );
});

When you use it with quotes it's as if you are trying to match a <this></this> element on your document. I'm fairly sure that's not what you want :)

Answer:2

I'm trying to create a simple meteor project based on the leaderboard example in their site. I want to add a small icon next to the score of each player. For doing so I created a folder named public ...

I'm trying to create a simple meteor project based on the leaderboard example in their site. I want to add a small icon next to the score of each player. For doing so I created a folder named public ...

  1. background image doesn't fill screen
  2. background image doesn't show css
  3. background image doesn't move when scrolling
  4. background image doesn't show
  5. background image doesn't work
  6. background image doesn't fill div
  7. background image doesn't show html
  8. background image doesn't work css
  9. background image doesn't display
  10. background image doesn't show blender
  11. background image doesn't scroll
  12. background image doesn't load
  13. background image doesn't show in safari
  14. background image doesn't show android
  15. background image doesn't fit
  16. background image doesn't show in firefox
  17. background image doesn't
  18. background-image url doesn't work
  19. css background image doesn't work
  20. html background image doesn't work

I'm very new to JavaScript and jQuery and I'm having trouble with a bit of code. HTML: <div class="toggle" style="display: block; width: 200px; height: 200px; background-color: red;">test</...

I'm very new to JavaScript and jQuery and I'm having trouble with a bit of code. HTML: <div class="toggle" style="display: block; width: 200px; height: 200px; background-color: red;">test</...

  1. access this inside promise
  2. access this inside arrow function
  3. access this inside function javascript
  4. access this inside settimeout
  5. access this inside foreach
  6. access this inside callback
  7. access this inside function
  8. access this inside map
  9. access this inside getderivedstatefromprops
  10. access this inside event
  11. access this inside event javascript
  12. typescript access this inside function
  13. angular access this inside subscribe
  14. vue access this inside function
  15. jquery access this inside function
  16. javascript access this inside callback
  17. react access this inside map
  18. javascript access this inside map
  19. angular access this inside function
  20. access to this inside prototype

In order to build the final JS source for a web app, I am compiling JavaScript templates, CoffeScript sources and vanilla JS vendor scripts. A final task, dependent on the former three, would then ...

In order to build the final JS source for a web app, I am compiling JavaScript templates, CoffeScript sources and vanilla JS vendor scripts. A final task, dependent on the former three, would then ...

  1. gulp dependent tasks order
  2. gulp 4 dependent tasks

I'm trying to login into Tumblr with CasperJS using methods start, fill and waitForUrl but cannot do this. It seems to me that form wasn't submitted, because timeout in waitForUr expired everytime. ...

I'm trying to login into Tumblr with CasperJS using methods start, fill and waitForUrl but cannot do this. It seems to me that form wasn't submitted, because timeout in waitForUr expired everytime. ...

  1. cannot submit form
  2. cannot submit form javascript
  3. cannot submit form jquery
  4. cannot submit form in safari
  5. cannot submit form laravel
  6. who cannot submit form 15g
  7. tinymce cannot submit form
  8. cannot submit pdf form
  9. powerapps cannot submit form
  10. infopath cannot submit form
  11. cannot submit html form
  12. ajax cannot submit form
  13. ckeditor cannot submit form
  14. infopath cannot submit the form. the parameter is incorrect
  15. infopath cannot submit the form an error occurred
  16. infopath cannot submit the form. access is denied