Skip to content

Instantly share code, notes, and snippets.

@pycarlson
Forked from dbc-challenges/jquery_quiz.js
Last active December 17, 2015 12:58
Show Gist options
  • Save pycarlson/5613256 to your computer and use it in GitHub Desktop.
Save pycarlson/5613256 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. */
/* Paulette and Travis
/* $('.feed-actors').replaceWith('<img id="theImg" src="http://1.bp.blogspot.com/-mgb_qCmyldI/UPhsGf58kjI/AAAAAAAALjs/TW2vDro5yU0/s1600/img-jc_wonder_woman_02.jpg" />');
/* $(".row").css("background-color", "red");
/* $('h1').text('I love Wonder-woman... what?');
/*2. Use basic selectors and the find() method to select an image on the page
and change it with another image of your choice. */
/* Dexter & Travis
/* $('body').find('img').attr('src','http://media.dcentertainment.com/sites/default/files/character_bio_576_wonderwoman.jpg');
/* $('body').find('img[title="Nathaniel Wroblewski"]').attr('src','http://media.dcentertainment.com/sites/default/files/character_bio_576_wonderwoman.jpg');
/*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.
/* Stefan & Travis
/* $('.feed-body.span5 h3').animate({
opacity: 0.25,
left: '+=1',
height: 'toggle'
}, 10000);
/*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).*/
/* Allen & Travis
/* $('#header-wrapper').on('hover',function(){$(this).css('background','red')});
/*5. Your choice. */
/* Robert & Travis
/* $('.span8').mouseover(function(){var colors = ["#f00","#0f0","#00f"];
/* var rand = Math.floor(Math.random()*colors.length);
/* $(this).css('background',colors[rand])});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment