//sample solution to script.js $(function() { $( "#button" ).click(function() { // Add the class of 'transition' with the duration // of 1000 and a callback to callbackFunction as // parameters. $("#writing").addClass("transition",1000,callbackFunction); }); function callbackFunction() { setTimeout(function() { // Remove the 'transition' class here $("#writing").removeClass("transition"); }, 1500 ); } });
Quotes help make search much faster. Example: "Practice Makes Perfect"
Monday, November 12, 2012
Codecademy: "Transition with addClass()"
//sample solution to script.js $(function() { $( "#button" ).click(function() { // Add the class of 'transition' with the duration // of 1000 and a callback to callbackFunction as // parameters. $("#writing").addClass("transition",1000,callbackFunction); }); function callbackFunction() { setTimeout(function() { // Remove the 'transition' class here $("#writing").removeClass("transition"); }, 1500 ); } });
Labels:
Codecademy,
jQuery
Subscribe to:
Post Comments (Atom)
This is an example of scrolling text using Javascript.
Popular Posts
-
//Sample Solution const gameState = {} function preload() { this.load.image('codey', 'https://s3.amazonaws.com/codecademy-...
-
//Sample solution to main.js var red = [0, 100, 63]; var orange = [40, 100, 60]; var green = [75, 100, 40]; var blue = [196, 77, 55]; ...
-
// Sudoku Solver Project function isPossibleRow(sudoku, row, number) { // This isPossibleRow() function returns true if the 'numbe...
-
$VERBOSE = nil # We'll explain this at the end of the lesson. require 'prime' # This is a module. We'll cover these s...
-
//sample solution function isMAC48Address(inputString) { if(inputString.length!=17){ return false; } var regex = /^([0-9A...
-
#Codecademy sample solution class Account attr_reader :name attr_reader :balance def initialize(name, balance=100) @name...
-
$(document).ready(function(){ $("button").on("click", function(){ var message = $("<span>Call 1-555-...
-
Problem: The Collatz function is defined as f(n) = 3n+1 for odd values of n and f(n) = n/2 for even values of n. What is the smallest poss...
-
Answer: From 1 to 9 days
-
Sample Solution: //document.write( "Ryan" ); document.write( " The length of Ryan is "); document.write( "Ryan...
No comments:
Post a Comment