javascript - Simple JQuery script animate not working -
javascript - Simple JQuery script animate not working -
so created simple html page :
index.html file:
<html> <head> </head> <body> <div class="menu"> hello </div> <div class="test"> menu </div> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="app.js"></script> </body> </html>
here app.js file:
var main = function() { $('.test').click(function(){ $('body').animate({ left: '500px' },200); }) } $(document).ready(main)
i'm trying understand did wrong , seems should work..
was tried download jquery-2.1.1.min.js
, work , still while clicking on menu , text not moving ..
you need set position
css property body
in order work left
.
body{ position:relative; }
ref : http://api.jquery.com/animate/
javascript jquery html
Comments
Post a Comment