Takenaka: Right. what do you mean “before”?
Takenaka: Like, in relation to the element in question.
Bleicher: Oh sorry. I mean DOM-positioning.
Takenaka: You could check indexes against each other i suppose.
Betance: My other idea was to use this.nextAll and check if it contains that.
Grauman: Which I’d do with .index I think.
Takenaka: What are you building, out of curiosity?
Renzelman: This.nextAll.indexthat = 0
Loynes: Takenaka: simple 10 line shift-click-to-toggle-multiple-checkboxes thing
Takenaka: Shouldn’t need to compare indices then.
Takenaka: Why do indices matter?
Zill: Takenaka: I’m using thisisAfter ? ‘nextAll’ : ‘prevAll’.addthis to figure out which rows to select.
Takenaka: Are you able to make a simple fiddle?
Takenaka: Because that still doesn’t make sense.
Charbonnet: HI everyone, I am using jquery cookie plugin for storing cookie and used it in WordPress website but I have some issues:
Dellosso: 2-code not work in safari browser
Vetsch: Fricken, how do you add jquery to a fiddle?
Takenaka: Sdegutis see the gear icon next to the “javascript” title in that box?
Takenaka: Click that and then on the “Frameworks & Extensions” dropdown
Galicia: Script type=”text/javascript” jQuerydo***ent.readyfunction$ { $”:checkbox”.on”change”, functione{ var checkboxValues; var CookieSet = $.cookie’checkboxValues’; ifCookieSet == null{ checkboxValues = {}; }else{ //$.cookie’checkboxValues’, null; checkboxValues = CookieSet; } $”:checkbox”.eachfunction{ checkboxValuesthis.value = this.checked; };
Takenaka: Syed_ show us your code.
Laskoskie: Https://jsfiddle.net/2gx4rk82/
Takenaka: Syed_ https://jsfiddle.net/
Towsley: It’s probably obvious at this point that JS isnt my day job :/
Muoio: Ok wait let me send u jsfiddle.net link
Takenaka: Sdegutis so what’s the story? what do i do?
Lazaroff: Takenaka: you ever use gmail or something where you can shift-click check boxes?
Pecorelli: Takenaka: it lets you toggle multiple at once
Gabhart: Takenaka: click one, then shift-click another further away fromit
Takenaka: Ah – right, get all between the first and last.
Takenaka: You’re overthinking this :
Rather: More clear: https://jsfiddle.net/2gx4rk82/1/
Takenaka: Nah i know exactly what you want.
Takenaka: This is easy – one sec.
Rapozo: Takenaka: oh no no, i know a much simpler way, i just dont know how to do it in jquery
Hudelson: Takenaka: whats your idea?
Takenaka: Just grab the index of the first clicked one and the index of the last clicked one. use https://api.jquery.com/slice/ and .prop’checked’, true against that result set.
Takenaka: No need to compare indices.
Hilser: Takenaka: well i will still need to order the indices
Ruckey: Takenaka: but yeah thats simpler
Takenaka: What does order have to do with anything?
Mckiddy: Takenaka: i dont know if .slice4,2 works
Swain: Takenaka: but yeah thats simpler, thanks
Takenaka: Except you’ll never have that case.
Streitz: Takenaka: however it shouldnt just be true, it should be lastValue
Takenaka: It should be the same as the current checked box.
Pietrini: Https://jsfiddle.net/ashikra/gy7bfwab/
Takenaka: Syed_ you have a syntax error.
Pianalto: Takenaka: the first one clicked and last one clicked might be in reverse order — im not following you
Doll: Takenaka: if you click the last one, then shift-click the first one, that should still work