Jun
17
comment jQuery index() in relation to all visible siblings
@user1689571 That is nearly equivalent. The only difference is that if the element itself is not visible, your way will return -1. If that's not a concern then your way is perfectly valid.
Jun
15
comment How to ensure method calls in a returned object literal use the intended "this"
Do you want to get reference to the object literal itself or to the "myObject" object?\
Jun
13
comment You are given a square matrix of size N times N. Calculate the absolute difference of the sums across the two main diagonals
How can the number of elements on a row vary if it is an NxN matrix?
Jun
13
comment Javascript find adjacencies
What you are calling a "block" seems to just be a single point. How does a single x,y,z combo define a block? How does your logic of all 3 coordinates being <=1 away from one another constitute a "face, edge or vertex" in common?
Jun
13
answered Javascript find adjacencies
Jun
12
revised How does the jQuery file upload plugin gain reference to file content in IE9?
edited tags
Jun
12
comment How does the jQuery file upload plugin gain reference to file content in IE9?
You should link to the specific plugin you are referencing. There is also a tag for "jquery-file-upload" that should add if it is the same plugin you are talking about.
Jun
11
comment How to create a sliced circle using CSS3/HTML5?
@JDev You can put text on the svg. Have a look at the <text> element. Unfortunately text in svg doesn't have wrapping and things like that, so it can be tricky if the text is dynamic.
Jun
10
awarded arrays
Jun
4
comment How to remove unnecessary margin on top?
@4127157 head and "header" are two very different concepts. From the spec "The HEAD element contains information about the current document, such as its title, keywords that may be useful to search engines, and other data that is not considered document content. User agents do not generally render elements that appear in the HEAD as content"
Jun
4
comment How to remove unnecessary margin on top?
You can't place div elements inside of head. div elements belong inside of the body.
Jun
1
comment Function doesn't fire on load, but works on resize
This is correct, but you can't control the height with css because that's the whole point. The idea behind the function is to compare the size of the h1 with the size of the div to be able to increase the font size of the h1 to make the h1 content the same height as the div. To "fill" the div.
May
31
comment Function doesn't fire on load, but works on resize
If you run it without calling the function the text is even smaller. Your function makes it a bit bigger with the first call, then bigger still on the 2nd, around the third call or so it reaches roughly an equilibrium. It has nothing to do with when or how it's called, it's the logic of the function, it takes a few calls to even out, which makes sense because it's based on the "original size" which changes with each call..
May
22
revised I am trying to get a data from a list of objects
added 5 characters in body
May
22
comment startsWith not returning expected value
Seems to work fine for me jsfiddle.net/hmzpsxtw
May
19
comment global variable undefined after setting it
It doens't work because it should be an else if. When a is 1, the first if changes it to 2 but the 2nd if then executes setting it back to 1.
May
19
comment global variable undefined after setting it
The important concept here is "variable hoisting". Even though the var a is lower in the function, the declaration of the local a is hoisted causing the alert to alert the local (yet to be defined) and not the global. developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…
May
19
comment global variable undefined after setting it
Are you sure it's a global variable? If this code is within any sort of function (onload?) then the variable is not global due to the var before it. Not to mention that you aren't changing the global (if it is global) because you are again using var to declare a new local.
May
19
comment Find previous element of same type regardless of parent
Certainly a good idea if the elements are not dynamic.
May
19
answered Find previous element of same type regardless of parent
1 2 3 4 5