These are chat archives for MontCode/GeneralChat

10th
May 2016
Jonathan Herman
@lantech19446
May 10 2016 18:16
it was starting to look that way in the first 3 lessons, honestly I haven't done anything in a few days. I need to get back on track. I've just felt so miserable with this horrible back pain that I haven't had the motivation to do anything
Jonathan Herman
@lantech19446
May 10 2016 23:00
man I really wish they would tell you that JQuery is case sensitive, if it weren't for Linux I never would have even thought of it.
Jonathan Herman
@lantech19446
May 10 2016 23:34

Not sure if anyone is around but I could use some help on lesson 123 it's target the parent of an element using JQuery. This is the code I entered but it's only satisfying 2 of the 4 requirements. When I add what it seems like they're looking for it breaks the whole thing.

$("#left-well").parent().css("background-color", "red");

Lily Romano
@Lilyheart
May 10 2016 23:35
I'm here, give me a sec to pull it up
Jonathan Herman
@lantech19446
May 10 2016 23:36
ty
Lily Romano
@Lilyheart
May 10 2016 23:36
What is the name of the lesson?
target-the-parent-of-an-element-using-jquery ?
Jonathan Herman
@lantech19446
May 10 2016 23:36
yes
might be 124
Lily Romano
@Lilyheart
May 10 2016 23:40
Your first selector is left-well. Then you are stating to modify it's parent which is the first col-xs-6 div. So you are actually targeting the first col-xs-6 div. Your final target should be left-well. The third requirement is a good hint.
Jonathan Herman
@lantech19446
May 10 2016 23:41

right and #3 was saying call the #target1 element so I had made it

("#left-well").parent("#target1").css("background-color", "red");

but that broke the whole thing,

Lily Romano
@Lilyheart
May 10 2016 23:43
In that code you are still starting with left-wall and then going to it's parent. The "child" is what is in the first parens. The function parent doesn't need anything in it's parens.
$("#target1").parent()
So when you read it, you go down the line. "Starting with class XXXX, go to it's parent and then change that parent's css.

So the example in the lesson shows

$("#left-well").parent().css("background-color", "blue")

which would read "Starting at left-wall, go to it's parent and change the parent's css to indicate a blue background."

Jonathan Herman
@lantech19446
May 10 2016 23:46

ooo ok, see the example they give is kind of misleading

$("#left-well").parent().css("background-color", "blue")

Lily Romano
@Lilyheart
May 10 2016 23:47

So with code like

      <div class="col-xs-6">
        <h4>#left-well</h4>
        <div class="well" id="left-well"></div>
     </div>

left-well's parent is col-xs-6, so that is the div that would be changed to blue.

Awesome!
Jonathan Herman
@lantech19446
May 10 2016 23:56
sorry got called away
Lily Romano
@Lilyheart
May 10 2016 23:57
No worries!
Jonathan Herman
@lantech19446
May 10 2016 23:58
oi sometimes I really wish they would do a better job of explaining this, or at least give an example more pertinent to that lesson lol