The animate method doesn't work?


	var color = [ '#FFA07A', ' #48c9b0 ', '#008080', '#808080', '#800000', ' #FFC300 ', '#1abc9c'];
	var quotes = ["Hmm. We’re having trouble", "finding that site.", "We can’t connect to the server at",
	"If that address is correct, here are three other things you can try:", "Try again later.", "Check your network connection.", 
	"If you are connected but behind a firewall, check that Firefox has permission to access the Web."];
	var length = color.length;
	var randomValue = Math.floor(Math.random() * length);
	$("html body").animate({backgroundColor: color[randomValue]},1000);
	$("#tweet-quote").animate({backgroundColor: color[randomValue]},1000);
	$("#tumblr-quote").animate({backgroundColor: color[randomValue]},1000);
	$("#new-quote").animate({backgroundColor: color[randomValue]},1000);
	$("#quote").innerHTML = quotes[randomValue];


Make sure you have added the jQuery UI library in addition to jQuery to your project.

FYI - Your quotes do not show, because you are not using the correct jQuery syntax. Read about the html method.

i included the JQuery UI but still not working!

Can you provide a link to your project code, so we can take a look at it?


Like I said before in my first reply, you need to add the jQuery UI library. You currently have the base jQuery library, but you need to add the UI library also.

I added these linkes and still not working, try it yourself

I already did and it works fine.

great, show me how to add the jquery ui correctly

Also look like you’re trying to reference files on your local machine, eg

<link rel="styleSheet" href="css/animate.css">

Don’t use link/script tags, go to settings and add the URL of the library you’re using to CSS/JS depending upon what it is.

still not working.

you can send me the edited code?

On a phone, so can’t check for errors, but this still applies:

Don’t use link/script tags, go to settings and add the URL of the library you’re using to CSS/JS depending upon what it is.

If you put the blurred out code in your Codepen, it should work. You will notice that I commented out the following line, because it was causing the scripts to break. Why? Because code pen expects the libraries to be adding via the settings (like @DanCouper mentioned). Without using Codepen, it should work. You will also notice that I used the full version of jQuery instead of the slim version, because the slim does not have all the functions needed for certain parts of the jQuery UI library to work properly.

Before I had your Codepen, I was using the full version of jQuery, so I was not having any trouble using your code.

<!--	<script src="js/customJs.js"></script>  -->
		<title> Random Firefox Error Messages Machine</title>
		<link rel="stylesheet" href="" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
		<link rel="stylesheet" href="">
		<link rel="stylesheet" href="" />
		<link rel = "styleSheet"  href = "css/style.css">
	<body style = "background-color: #333">
		<div class= "row">
			<div class= "col-sm-4">
			<div class= "col-sm-4">
				<div class = "quote-box" id="quote-box">
					<div class="qoute" id = "quote">"Hmm. We’re having trouble"</div>
					<div class="buttons">
						<a id="tweet-quote"  class="button" title = "Tweet this quote!" target="_blank"
						href= ""
					    <i class="fa fa-twitter"></i>
						<a id="tumblr-quote"  class="button" title = "post this quote on tumblr" target="_blank"
						href= "" 
					    <i class="fa fa-tumblr"></i>
						<button id="new-quote" class="button"  >
						New quote
			<div class= "col-sm-4">
		<script src=""></script>
    	<script src=""></script>
	<script src="" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
	<script src="" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>	
<!--	<script src="js/customJs.js"></script>  -->

Thank you , you added the right links
these two scripts handled the problem

>  <script src=""></script>
> <script src=""></script>

Thank you Dan
i get it