Skip to content

Instantly share code, notes, and snippets.

@NCCastillo
Forked from dbc-challenges/jquery_quiz.js
Last active December 18, 2015 07:49
Show Gist options
  • Save NCCastillo/5749331 to your computer and use it in GitHub Desktop.
Save NCCastillo/5749331 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.
Choose a new pair for each. Add your names to the section you complete.
*/
/*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. */
$(document).ready(function() {
$('h1').css({"color":"hsla(20, 50%, 50%, 0.5)", "float":"right"});
});
/*2. Use basic selectors and the find() method to select an image on the page
and change it with another image of your choice. */
$(document).ready(function(){
$('#wrap').find('.dropdown').hide();
});
/*3. Use traverse methods to select all instances of a repeated word on the page
(like code) and use the animate() method to modify it. */
$('#objectives').replaceWith($('#objectives').text().replace(/j/gi, "<span id='match'>JJJJJJ</span>"));
$('#match').css({"color":"red"});
/*5. Your choice. */
$(document).ready(function(){
for(var i=0; i<100; i+=10;) {
if (i%20===0) {
i -= 5;
};
$('*').animate({"font-size":"i"}, 'slow');
};
for(var i=100; i>16; i-=10;) {
if (i%20===0) {
i += 5;
};
$('*').animate({"font-size":"i"}, 'slow');
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment