Skip to content

Instantly share code, notes, and snippets.

@Carpk
Forked from dbc-challenges/jquery_quiz.js
Last active December 27, 2015 10:09
Show Gist options
  • Save Carpk/7309612 to your computer and use it in GitHub Desktop.
Save Carpk/7309612 to your computer and use it in GitHub Desktop.
/* Here is your chance to take over Socrates!
Spend 10 minutes on each of the following hacks to the Socrates website.
Enter them in the console to make sure it works and then save
your results here.
*/
/*1. Use basic selectors (id, class, element) to choose an element on the page.
Use the .css() method to alter at least two CSS properties of this element. */
URL Modified: http://socrates.devbootcamp.com/cohorts/30
jQuery code: $(".muted").css("width", 600);
$(".muted").css("height", 300);
/*2. Use basic selectors and the find() method to select an image on the page
and change it with another image of your choice. */
URL Modified: http://socrates.devbootcamp.com/users/699
jQuery code: $(".user").find("img").attr("src", "http://www.hedweb.com/animimag/horse-beach.jpg");
/*3. Use traverse methods to select all instances of a repeated element on the page
(like the h3 surrounding the words 'Code Review' ) and use the animate() method to modify it.
*/
URL Modified: http://socrates.devbootcamp.com/
jQuery code: $("h3").animate({height:"toggle"}, 1000, function(){});
/*4. Try to find an element that requires at least three selectors / traverse
methods to locate it and then use the .on() method to bind an event handler
on these elements (use an event other than click).*/
URL Modified: http://socrates.devbootcamp.com/cohorts/32
jQuery code: $("#main-content .row h1").on("mousemove", function(){$(this).fadeOut(800)});
/*5. Your choice. */
URL Modified: http://socrates.devbootcamp.com/cohorts/32
jQuery code: $("img").on("mousemove", function(){$(this).attr("src", "http://www.hedweb.com/animimag/horse-beach.jpg")});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment