Eyad Syria-lover Posted September 1, 2016 Share Posted September 1, 2016 This Code Isn't Working: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script> $(document).ready(function(){ $("#area").animate({ backgroundImage:"url('image2.png')" },2000); }); </script> <style> #area { width:100%; height:600px; background-image:url("image2.png"); } </style> <div id="area"></div> Link to comment Share on other sites More sharing options...
Ingolme Posted September 1, 2016 Share Posted September 1, 2016 (edited) I'm not sure what you expected it to do. You can't animate background images, you can only animate properties with numbers as values. (colors are also numbers) Here's a list of properties that can be animated: http://www.w3schools.com/cssref/css_animatable.asp jQuery is capable of animating a few Javascript properties which aren't on that list, such as scrollTop. Edited September 1, 2016 by Ingolme 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now