Skip to content

Instantly share code, notes, and snippets.

@ericchen0121
Forked from dbc-challenges/jquery_quiz.js
Last active December 20, 2015 02:19
Show Gist options
  • Save ericchen0121/6055765 to your computer and use it in GitHub Desktop.
Save ericchen0121/6055765 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. */
Eric & Jesse:
$('.brand').text('JesseJay'); // not css method...
$('.row').on( "mouseover", function() {
$(this).css( "color", "red" );
});
Eric & JAKE
$('h2').mouseover(function(){$('.brand').css('color', 'blue')});
$('.btn[name="button"]').hide();
ERIC & CHRISTINE
$('.row').on( "mouseover", function() {
$(this).css( "color", "green" );
});
$('h1').mouseover(function(){$('.btn').css('color', 'purple')});
$('h1').mouseover(function(){$('.btn').css({'color': 'black','font-size': '30px'})});
/*2. Use basic selectors and the find() method to select an image on the page
and change it with another image of your choice. */
/*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.
*/
/*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).*/
ERIC & MICHAEL HO
$('.content .tab-pane h2')
$('.content .tab-pane h2').text("My name is eric and i'm sooooo cool")
$('.btn').mouseover(function(e){this.disabled=true});
/*5. Your choice. Make a dynamic mouse over effect so you can't click on an element. */
ERIC & CHRISTINE
$('.btn').mouseover(function(e){this.disabled=true});
ERIC & MICHAEL
$('.btn').mouseover(function(e){this.disabled=true});
$('.btn').mouseover(function(){this.disabled=true});
$('.btn').mouseover(function(e){$(this).disabled=true}); //this doesn't work bc it's jquery
$('.btn').mouseover(function(){$(this).prop("disabled", true)}); //jquery disabled method WORKS!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment