Adding a jacket over my page

css

#62


#63

Paul is the one who said he showed me how to do it 3 times that same day. Now I’m trying to figure out what it is he showed me. Because I still can’t figure it out.

If he says showed me how to do it, then he showed me and I’m still stumped. Which doesn’t make any sense cause I should’ve figured it out by now.

I want to know how to resolve this so I don’t run into it again, and if I do I’ll know how to fix it right away.


#64

This was only about 4, or 5 days ago.

I narrowed it down to these 3 threads:

It has to be in one of these:

1.) Adding a jacket over my page

2.) Converting the inline javascript to pure javascript, how would this be done?

3.) How would I fix these jslint errors?

I don’t think it is 2.)

It might be 3.) “use strict” is mentioned briefly, but nothing in detail that would help me to figure this out.

And I don’t think it’s this thread 1.)

Now I feel as though I hit a dead end.

He says he showed me but I still can’t find where it is.

Now I feel stupid for not being able to find the post, or posts. It wasn’t even a long time ago.


#65

I went back and reread everything you showed me and I still don’t understand what I’m missing, or what I’m not understanding.

Let’s go back:
jslint is only telling me to “use strict” on just this line of the code, not any others.

I do that here:

(function iife() {
        "use strict";
        document.querySelector(".jacketa").addEventListener("click", function() {}());

And get this error in jslint:

And what happens with this line: It would need to be attached to something. Maybe create a function for it to go into. Either that or it goes into the above function.

  document.querySelector(".container").classList.remove("hide");
});

If they are meant to go together like this:


(function iife() {
        "use strict";
        document.querySelector(".jacketa").addEventListener("click", function() {
            document.querySelector(".container").classList.remove("hide");
        }());

I get these errors:

I have an example of how you make a line shorter I would need to figure out how to separate the above line in half somehow.

This:

  function hideAllButtons(button) {
    button.querySelectorAll(".play, .pause, .initial, .speaker").forEach(hide);
  }

Becomes this:

  function hideAllButtons(button) {
    var buttonSelectors = ".play, .pause, .initial, .speaker";
    button.querySelectorAll(buttonSelectors).forEach(hide);
  }

#66

I think I just fixed it, can you please tell me if I did.

No errors now in jslint.

Did I do this right, correctly?

(function iife() {
    "use strict";
    document.querySelector(".jacketa").addEventListener("click", function () {
        document.querySelector(".container").classList.remove("hide");
    });
}());

Full Code:


(function iife() {
    "use strict";

    function hide(el) {
        el.classList.add("hide");
    }

    function hideInitialOverlay(wrapper) {
        hide(wrapper);
    }

    function initialOverlayClickHandler() {
        var wrapper = document.querySelector(".jacketa");
        hideInitialOverlay(wrapper);
        wrapper.removeEventListener("click", initialOverlayClickHandler);
    }

    function initButton(selector) {
        var wrapper = document.querySelector(selector);
        wrapper.addEventListener("click", initialOverlayClickHandler);
    }
    initButton(".jacketa");
}());
(function iife() {
    "use strict";
    document.querySelector(".jacketa").addEventListener("click", function () {
        document.querySelector(".container").classList.remove("hide");
    });
}());

All Updated No errors:
https://jsfiddle.net/bwa3os2v/241/


#67

@Paul_Wilkins I feel like such an idiot now for not realizing the mistake I was making.

I forgot to add this piece in.
}());

And I think this is the correct code now.

(function iife() {
    "use strict";
    document.querySelector(".jacketa").addEventListener("click", function () {
        document.querySelector(".container").classList.remove("hide");
    });
}());

#68

Are you still angry at me? I said I was sorry, I didn’t mean it. It wasn’t intentional.

When I had copied and pasted I forgot to remove those two quote boxes from it, that’s all it was.

"[quote] [/quote] "

I didn’t mean for it to seem like you said something when you didn’t.