« first day (504 days earlier)      last day (3284 days later) » 

3:02 PM
@PatsyIssa lol what the fuck
 
ooh are we discussing good movies?
 
Hahahaha
 
that's my favorite
 
The dark side of youtube :P
you guys know rejected cartoons?
 
ughhh, got an e-mail from a client "when they click the first oval (my manager would like something other than boxes. she wants something unique and different)"
 
3:03 PM
The makeup artist for that video must have been super skilled
 
lol
 
I wanna say "well, unique and different is gonna cost extra" -_-
 
badumtiss
 
@TylerH so say it, just use more technical terms
 
@rlemon my fav part is the alfred hitchcock shower scene :P
 
3:08 PM
That was amazing
 
Stupid question, but nth-of-type works on element type, not a class, correct?
 
@mikedidthis ya
 
iirc, nothing works specific to classes, right?
 
Just posted a song to JamExchange that you will either love or hate, haha. I love it
@mikedidthis javascript does :D
 
lul
.one + .one :D
 
3:10 PM
14 seconds in.
closed
@ZachSaucier what the fuck did I just see
 
hahaha
it's so good
 
That's really strange
But I'm listening on
This seems like one of those videos that people can only enjoy high
 
I must be high all of the time, haha
 
@mikedidthis can't you just use nth-child ?
 
Huh, you must be.
 
3:12 PM
@rlemon applies to the element type, not the class?
 
Seriously, what is that video?
 
it gets better as the song goes on
 
nth-child applies to whatever you want
 
@easwee select2 was the dropdown you use?
 
It's pretty funny to me XD
 
3:13 PM
@SomeGuy I learned some new dance moves
 
@rlemon I want to know when I have the last element with a class, but the parent contains mixed classes.
nth-child doesn't work.
 
@ZachSaucier That was really weird, hahaha
 
haha, enjoyable to me
 
@mikedidthis bruh
last-child
 
Yeah, I kind of enjoyed it
 
3:15 PM
How can I stop an odd image ruining my layout? :( I need a height: width/1.5; for CSS
 
In the sense that it made me laugh
 
@TylerH mixed classes
 
@Billy elastic video technique
 
@mikedidthis you just copied mine ?
 
3:18 PM
if only nth-last-child wasn't stupid and didn't crap out like last-child
 
ew jsbin
can never tell when I'm ruining someone else's work
 
@TylerH it tells you :D
 
I prefer JSBin so much more to JSFiddle now
Plus, rem is a lot more responsive too if you have any problems / suggestions
 
@mikedidthis dun use mixed classes
case solved, where's my scooby snack
 
3:20 PM
@SomeGuy +1
 
MLM ftw
(also me since I used last-child too)
 
MLM
:P
 
@MLM sadly I need to know when its the last of a certain class, not the last element in a container :/
As there is only ever two elements together, I am just chaining them
@TylerH not quite, but a snack for trying.
 
@mikedidthis quite*
 
@SomeGuy thanks buddy! Been a while.
 
3:23 PM
It has
 
MLM
So it needs to be the last child of a parent, But only if it has a certain class?
 
no, it just has to be the last child with a certain class.
Its ok, I got it, as there are never more than two elements with this class and they are together.
Thanks anyway.
 
function lastOfClass(k,p) {
  var parent = p || document;
  var selector = k.slice(0,1) === '.' ? k : '.' + k;
  return [].pop.call(parent.querySelectorAll(selector));
}
done and done
:D
 
or... do it with CSS :D
 
fuck yo CSS, JS FTW!
 
3:30 PM
jQuery all the things
 
fuck yo mamma
 
I don't know how you guys do in the UK, but in Canada that is illegal.
 
@mikedidthis are the two classes always gonna be in the same order?
 
@TylerH they will always be a pair. I already did it, just creating an example for y'all.
 
where is my damn themes!?
 
3:38 PM
@rlemon and widgets and its yours :D
 
3:50 PM
Can I use javascript to trigger the browser's native "scroll to hash location"?
I thought of simply setting a hash location but if it's the same as the current hash location I don't think anything will happen (Will it?).
 
Try it
 
It probably won't
 
I'm guessing one of you upvoted one of my last class SO answer
 
3:53 PM
You can probably change the hash, as well as use scrollIntoView() on the element
(Assuming you do want the hash to update)
 
@mikedidthis got a random upvote on a year old answer dealing with selecting the last of class (I had forgotten about the answer). Given the discussion we've been having I suppose it's someone in the room
 
scrollIntoView() isn't 100% supported so for that reason I'd rather tap into the browsers' native hash location handler
 
@ZachSaucier ohh can I see?
 
user652649
WAT
 
1
A: How can select first child/last child of class in a mixed container?

Zach SaucierUse nth-child or nth-of-type Live Example .main .black:nth-child(2n) { color:yellow; } Or if you want them to be separate This demo .main .black:nth-child(5n-6) { color:yellow; } .main .black:nth-child(5n-4) { color:purple; } The function calculates using n = element of type, ...

 
3:58 PM
@Billy Well, if you want full compatibility, you should probably use scrollTo after getting the element's offset
 
user652649
scrollIntoView is supported pretty much everywhere @Billy
 
user652649
i think existed in msie5 already
 
Yeah, even IE6 has it
 
user652649
not sure about the "center" argument
 
Don't know how far back you want
 
3:59 PM
Netscape.
 
user652649
asd
 
Oh yeah, not sure why I thought it wasn't...
 
user652649
@Billy maybe you are talking about scrollIntoViewIfNeeded
 
user652649
that's poorly supported
 
user652649
@mikedidthis how pomodori go?
 
user652649
4:02 PM
pomodoro = pomo d'oro = golden pome, despite it's red (TYL)
 
user652649
i know you didn't ask.
 
posted on September 16, 2014 by kbironneau

/* by javidcf */

 
user652649
what happened to purify? and that guy from malta? can't remember his nick
 
user652649
also how @DarkAshelin's new life going?
 
@WesleyCrushed wat?
 
user652649
4:07 PM
@mikedidthis pomodori
 
@WesleyCrushed what about them?
 
user652649
@mikedidthis pomi d'oro
 
@ZachSaucier That was me
 
I have two functions as properties of the same object, one handles scrolling and one handles keydown events. this is the object in the scroll handler but it becomes the document in the keydown handler. Any ideas why?
 
I actually came to it via a google search
 
4:08 PM
 
user652649
@Billy event handlers != your application api
 
I don't understand :p
 
Show us your code
 
I wish you could throw parentheses around classes in CSS
 
user652649
basically if you do element.addEventListener("onwheel", yourobject.thehandler); it's not correct
 
4:10 PM
$(window).resize(function(){jscroll.vcent();});
$(window).scroll(function(){jscroll.handleScroll();});
 
(.one + .two):last-child
 
user652649
it should be element.addEventListener("onwheel", function(){ yourobject.thehandler(); });
 
user652649
to get the correct "this"
 
user652649
(but that's partially correct)
 
@TylerH could propose it discourse.specifiction.org
 
4:11 PM
Inside those functions, you assume this is jscroll?
 
@SomeGuy that's what I thought. It is that inside handleScroll but not inside vcent
 
posted on September 16, 2014 by Guest Author

The following is a guest post by Joni Trythall. Joni recently finished a Pocket Guide to Writing SVG. I've been excited about SVG for a while now, working with it, learning about it, writing about it... but there is so much to know. It really is another whole universe of the web. So I reached out to Joni to see if she would like to write something for CSS-Tricks on SVG and she agreed! Here's Jo

 
oh shet. nevermind!
document.onkeydown = this.handleKeyDown;
that is where this becomes document
 
Yeah
 
user652649
var THIS = this;
document.onkeydown = function(){ THIS.handleKeyDown() };
 
4:12 PM
@Feeds good article
 
so should I make it an anonymous function and call the function from inside
Yeah, that. Thanks @WesleyCrushed
 
user652649
because internally the event is dispatched like document.onkeydown.apply(document, event);
 
@WesleyCrushed The convention is usually to use var self = this; or var that = this;
 
depending on what support you need imo bind is cleaner however it is slower.. but unless you're making some high performance application such as a game you wont notice a difference
 
user652649
@SomeGuy idgaf about convention xD
 
4:14 PM
bind isn't supported as much either, though
 
@SomeGuy isn't it IE9+
 
user652649
as rlemon and i found out, bind is not the solution either
 
> Basic support (IE 9)
 
user652649
wait i'll show you
 
Ooh, I forgot that IE9 is as far back as we should be supporting
 
user652649
4:17 PM
take this for example:
 
user652649
var x = {};
x.doSomething = function(){
alert("foo");
};

document.addEventListener("wheel", x.doSomething.bind(x));
 
user652649
looks fine until you realize that you can't document.removeEventListener
 
user652649
document.removeEventListener("wheel", x.doSomething.bind(x));
 
user652649
wont work
 
user652649
or even document.addEventListener("wheel", x.doSomething);
 
4:19 PM
It works if you store the bound function
 
user652649
yes
 
user652649
that's my point
 
Yours doesn't because bind creates a new function each time, so what you're trying to remove isn't the same as what you've added
 
user652649
you always need to store the bound function or a wrapper closure you created manually
 
user652649
 
4:20 PM
Uh, okay. But how is bind not the solution either?
It still works. You just need to keep another thing in mind
 
user652649
that's not a "complete solution". why would anyone use it?
 
Depends on your definition of "complete solution". It does what I'd expect it to do, that's a solution to me
 
user652649
it's not well designed
 
user652649
i mean if you intend to use it inline with addEventListener
 
user652649
if you use it like so then it makes sense jsfiddle.net/sstcyfh4/1
 
4:23 PM
Exactly
If people don't understand how bind works, it's not the language's fault
The language remains consistent
 
looks/works fine to me idk
self/that always feels like a hack to me
oops error ;P
 
I'm used to it :P
 
there we go.
@SomeGuy yeah I just hate it, can't wait until bind is faster
thats the only reason I don't use it in games
 
That's sad
 
I need to grab one of those
 
4:29 PM
i hate jquery they deprecate function too fast
 
user652649
@mikedidthis pomodoro
 
which one is deprecated that you need?
 
@WesleyCrushed wat?
 
ajax ... error and success
 
that's been deprecated for a long time
finally being removed I think
 
user652649
4:31 PM
@mikedidthis just trying to be very annoying and pomodoro
 
(the notice has been up for like a year at least)
 
what vs is it being deprecated in? 2+?
 
yes
 
well why in the heck are you using JQ 2.0 :P
 
4:34 PM
it's been deprecated for 2 years, and on the removal notice since then
I get annoyed that jQuery holds onto deprecated crap so long
 
i was just writing answer after a long time ... ..and i found that those functions are deprecated :(
i was just writing answer after a long time ... ..and i found that those functions are deprecated :(
 
@ZachSaucier What weight does that website have with the w3c?
 
w3 looks at the proposals that do well
 
ohh now its .done, .fail and .always ... i hope there wont be completelyDone , completelyFail and always function
 
@NullPoiиteя nope, it will be .completelyAlways
 
4:41 PM
unable to post message while i can reload the page successfully
 
I thought the parent selector wasn't going to be implemented in CSS Selectors Level 4. this language makes me think otherwise, however; that it will be implemented using the same method as jQuery's :has(). Am I correct or mistaken?
 
@TylerH In Selectors 4, but not within CSS
 
@TylerH I heard the opposite, that it was going to be implemented in level 4
 
They just replaced the strange syntax with :has()
 
4:47 PM
@BoltClock so I won't be able to use :has() in a CSS file
 
But it's still tentatively excluded from CSS
@TylerH Yeah
 
that is such bullshit
let me use the damn selector if you're gonna add it'
 
:has is a much better syntax wow
 
doesn't has target content?
like, has is a synonym for contains
 
@BoltClock any particular interesting things so far?
 
4:48 PM
No. It has never been a synonym for contains
 
Well in the english language it is
 
@ZachSaucier Not sure, but it's PR now
 
> Description: Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
 
how else am I supposed to interpret it
 
@TylerH Well yeah
I would have preferred that other syntax instead of a pseudo-class, but a pseudo-class offers a lot more flexibility
 
4:49 PM
okay so has isn't going to be used on the element we want to target, but on the parent element?
 
@k111ky why you unfollow me?
 
Unfortunately it also leads to more performance complications which is why I don't think it'll make it into CSS, or if it's to be implemented in CSS browser devs have to find another way

BoltClock Geeks Out about CSS Selectors

Sep 1 at 5:05, 34 minutes total – 70 messages, 4 users, 0 stars

Bookmarked Sep 1 at 6:50 by BoltClock

 
like instead of saying div < .apple {} we will say div:has(.apple)?
 
@TylerH E:has(F) finds the E in E F
E:has(> F) finds E in E > F
 
that doesn't make any sense
okay
is that first carat supposed to be there?
 
4:51 PM
Yeah. If you prepend a combinator it uses that combinator for scope
 
so why can't we use that shit in CSS
 
Because performance, reflow, etc
Or so they say
 
fuck performance let me select what I want -_-
E:has(> F) is looking for an E with a direct descendent of F?
 
If only more people thought like you
 
not used to Tyler cussing like this.
 
4:52 PM
E:has(> F) finds E in <E><F/></E> but not E in <E/> or <E><G><F/></G></E>
 
It happens on occasion but I don't think "performance" is a valid reason to decide "we're going to add it to the spec but not allow it to be used by CSS"
so it really upsets me that they're doing this
 
It's basically E > F except you target E, not F
 
@BoltClock right, so like I was saying before, you put the :has on the parent instead of the descendant
 
Yeah
 
so it's a synonym for contains
instead of a "parent selector"
 
4:54 PM
In English, maybe
I don't like the term "parent selector". It's stupid
 
why?
means select the parent
 
Implies that the only thing it can do is select parents
 
so the difference is that it scans the content of selectors rather than going backward up the flow
well that's the point, isn't it?
 
It depends on the implementation
 
:has() is fundamentally different from parent < child
 
4:55 PM
I haven't bothered to look at how jQuery does it, and idk if vendors will implement it the same way
 
Hi. Anyone please willing to help me sort of redesign Modal PopUp? I just need to know how to edit the top margin so it would display upper: gist.github.com/mareksip/dce95b26feec632b4007
 
I don't know the details of performance for either of those two but I think the former is way less performant than the latter
but also more powerful
 
@Marek if you're more clear with what the problem is and give an example we will be much more willing to help
 
@ZachSaucier Currently the Modal goes to center I would like to be under the link bar in browser. I am kind of new to CSS and don't know much about it. sorry.
 
now do the second part of my message
 
4:57 PM
E:has(+ F:last-child) matches E in <root><E/><F/></root> but not <root><E/><F/><G/></root>
Powerful indeed
 
if you can truly use combinators (is that the right term) like + and > and ~ like you are suggesting, @BoltClock, then it might be the only method we need in CSS anymore
just about, anyway
 
You're not the only one upset about this btw ;)
@TylerH Yes, those are combinators
 
@ZachSaucier The Modal now appears in center like this: netdna.webdesignerdepot.com/uploads/2012/08/modal_final.png
 
The entire argument in :has() is called a relative selector
 
@Marek So close, but link us to that web page instead :)
 
5:00 PM
See also the :scope pseudo (which is implemented in querySelectorAll in some browsers now I think)
 
!!google :scope css
 
@ZachSaucier codepen.io/jehope/pen/korvK this is it
 
weird scope reminds me of the shadow dom
 
It does, doesn't it
 
5:02 PM
@Marek change .modal:target + .modal-dialog { top:20%; ... } to .modal:target + .modal-dialog { top:0%; ... }
 
too many things to read when I get home
 
@BoltClock hah makes sense :p
 
@ZachSaucier I wish it would be displayed upper like this. May you please have a minute ? imgur.com/tfLkoei
 
@Marek I literally just told you :)
 
5:04 PM
oh god
please tell me they aren't introducing scope to CSS
 
@ZachSaucier Thank you sir, sorry for annoying.
 
@TylerH if they give us everything we need then they won't have jobs ;)
 
This is why I can't wait till Selectors 4 is implemented and people start asking if something is possible with one of the new things
 
@BoltClock I feel like you'll already have an answer so you can copy and paste to the relevant questions
not duping, but for each topic
 
you guys see this, and is anyone considering going? codepen.io/meetups
 
5:11 PM
@ZachSaucier How did you know
 
safari is telling me that "null is not an object" on this line:
this.toggleLayoutBtn.onclick = function(){jscroll.toggleLayout();};
but works on all other browsers.. not sure why
 
eh nm its only a 2 hour meetup not going to Texas for that.
 
I have a logic question - how could I generate such sequence false false true true false false true true in javascript avoiding if statements - it's like odd/even but doubled?
 
What do you mean by sequence
 
hey
 
5:17 PM
@Loktar I wouldn't go to Texas for anything
 
@BoltClock i was doing and alternating switch in js - turning a boolean from true to false - now I would like to do it on each second loop - so I have twice true and twice false
 
aww why not, Texas is great
 
@easwee What does your code look like?
 
why border-bottom in the following CSS rules doesn't work?
 
my experience in Texas was being screamed at by a large man with a smokey the bear hat for 8 weeks
 
5:18 PM
@TylerH yeah, why
 
border-top: solid #FFF 2px;
border-bottom: solid #FFF outset 2px;
 
was such a great time.
 
doesn't sound great to me
omg, treehouse "because the space in between them is considered... combinated"
you mean combined
can't believe he said that on video and didn't realize it
 
@MRS1367 There's no such thing as an outset border
A border is a border
 
@BoltClock sec I'll make a fiddle
 
5:20 PM
@MRS1367 Oh wait you mean the outset border style. That's because you have solid and outset in the same declaration...
It's either solid, or outset. Not both
 
jsfiddle.net/d2hjb524 Yeahhh outset borders = windows 98
 
:')
 
@BoltClock jsfiddle.net/k6xz9npv/1 now it's simple true false true false - I 'm trying to get it to output true true false false true true false false to console
so the boolean stays true on two function calls
 
I see what you mean. I can't think of a solution besides changing it based on another variable though
 
@easwee on each output add an if block with a doOnce to repeat the last output. if the last two outputs == each other, don't do the doOnce?
 
5:26 PM
Hello, all.
 
I don't know if that's how doOnce works; I'm not a javascript person
Hey Jonathan
 
@JonathanSampson It's the former SO mod turned IE guy!
 
@TylerH read up - I'm trying to do it without if - but don't know what math to search for since it's like odd/even function but doubled
 
oh I didn't see that bit about no Ifs
 
@BoltClock The programmer formally known as SO Mod :)
 
5:27 PM
what about Ands or Buts?
 
I need some type of awesome Unicode symbol to use in place of my name :D
 
@TylerH must be some simple math but I'm having a mind block xD
 
@JonathanSampson U+0135 :-P
 
@JonathanSampson that's so 2007 :P
 
5:29 PM
or U+2149
 
Here's a bit more sophisticated way to do it :P
 
@BoltClock !! basically returns boolean even if string or number is passed? right?
@SecondRikudo ^
 
@easwee Yes it essentially converts it to a boolean
 
ok got it
thx for help
 
5:34 PM
@SecondRikudo I see false true true false false true false ..
@easwee np
 
this specifiction post is really difficult to write
 
45
A: What's the most concise way to get the inverse of a Java boolean value?

BoltClockJust assign using the logical NOT operator ! like you tend to do in your condition statements (if, for, while...). You're working with a boolean value already, so it'll flip true to false (and vice versa): myBool = !myBool;

I don't know why I have answers to Java questions
Maybe at one point in time I really did get Java and JavaScript mixed up :(
 
5:40 PM
@BoltClock You even remember your answers in languages you hardly know xD
 
have you worked in those before?
 
lulz - that's what I've needed that js part for codepen.io/easwee/pen/wbvue
 
@ZachSaucier A bit of Perl, Python and ActionScript
I should finish my Flash game while Flash is still alive
 
5:54 PM
@easwee have you see the 3d rofl copter?
 
@Loktar yes - that is some amazing stuff
 
yeah pretty crazy
 
this is just me strugling with javascript trying to learn something xD
 
@Loktar link link link
 
its an older pen, but pretty cool
 
5:56 PM
			this.toggleLayoutBtn = document.getElementById('toggle-view');
			console.log(this.toggleLayoutBtn);
			this.toggleLayoutBtn.onclick = function(){jscroll.toggleLayout();};
why is safari telling me this.toggleLayoutBtn is null?
 
different scope
 
@Loktar love it
@Billy because it is B)
 
it works in all other browsers and also all references to that variable are in the same scope
 
I don't know the details but from what I've read, any time there's a problem with the expected output of this, the answer is related to scope.
 
@Billy hard to believe that - can you make a fiddle?
 

« first day (504 days earlier)      last day (3284 days later) »