Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

Conversation

@Astrolingus
Copy link

No description provided.

Is_He_Gay.html Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to uncomment this line... init() is never being called.

@afeld
Copy link
Member

afeld commented Oct 8, 2014

I appreciate you putting a lot of effort into getting this to work, and I know it can be frustrating. Normally, I would let you work out the solution, but I want to get you unstuck. Here's how I would rewrite your current code, jQuery-ified:

var soundButton, hiddenBox;

var init = function() {
  soundButton = $('#sound');
  hiddenBox = $('#popUpSound');
  // register all the event listeners at once
  soundButton.on('click', showPopUp);
  hiddenBox.on('click', hidePopUp);
};

var showPopUp = function() {
  hiddenBox.show();
};

var hidePopUp = function() {
  hiddenBox.hide();
};

// basically the same as window.addEventListener('load', init)
$(document).on('ready', init);

Let me know if you have any questions!

Also, this pull request is live at http://astrolingus.github.io/react/Is_He_Gay.html, but all of the images are broken. It makes my life a lot easier if you make http://astrolingus.github.io/react/ display the project... would you mind renaming Is_He_Gay.html to index.html, and make sure that version works? Whatever additional workflow you use (e.g. having a Classwork repository) is up to you, but it makes reviewing a lot easier if everyone's projects are in a consistent place. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants