I was working with `slideToggle` today, and just assumed it took an optional boolean value to force the state to be on/off (or down/up as it were) just like `toggle` and `toggleClass`. I obviously was wrong.
I looked at the jQuery source to see how `slideToggle` is handled, and it basically builds an animation where "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" are all set to the value "toggle".
I worked up a patch that would give `slideToggle` the optional `state` parameter without breaking existing functionality, and committed it to my fork. Before I sent a pull request, I was hoping for feedback or help on the patch I was writing. Obviously, if it is not wanted, then I don't want to spend more time on it either! :)
The only downside I see is that there is now an extra function call to the original `slideToggle` (Moved to _slideToggle) when no state parameter is passed.
On the little login box, there are no `label` elements used on the two checkboxes ('Keep me signed in' and 'Secure Login'), so you have to click directly on the check box instead of being able to click on the much larger target of the text next to the label. Here is what the current box looks like:
This is what the code should look like to properly function in all modern browsers. Both checkboxes need a valid `id` and a label that has the `for='validid'` attribute.:
I know there is some overlap in the forums with StackOverflow, so I just wanted to mention something about the moderator voting that just started yesterday.
Two of the users running for moderator spend some (or almost all) of their time in the jQuery and JavaScript tags on SO. The two current StackOverflow moderators (who will remain) are experts in Java and C# respectively. I think it would be really great to get a moderator on StackOverflow that has his own special interest in jQuery and JavaScript. These two guys have that focus, and it would be great to see them voted in:
Jonathan Sampson: Jonathan is ranked #1 for jQuery questions in the last 30 days (and has been for some time) and is #6 for all time jQuery questions.
Gumbo: Gumbo spends a lot of his time on PHP, Apache, HTML, CSS, Javascript + jQuery questions. Gumbo has been active on Stack Overflow for a while and has gained over 51K reputation.
Regardless of this post, please make your own review of each candidate and judge if they would be good for StackOverflow as a whole community.
Each of the candidates are skilled programmers in their own right. I am not casting a judgment call at all... just looking for some jQuery special attention over there :)
If you are an existing member of Stack Overflow with over 200 reputation, take time to vote.
Update: I guess I should add the disclaimer that Jonathan Sampson and I have become friends through Stack Overflow so this is not fully impartial. However, I think either he or Gumbo would be a good representation for Front End development and jQuery if they were elected as a moderator.
Additionally, some of the other candidates may also answer jQuery questions. Gumbo and Jonathan, however, are the only two names I run across a lot when answering jQuery questions over there.
I reported this as a bug back when all the awesome 14 days stuff was going on, so I wanted to just reference it here in the forum and see if anyone else came across this problem (or my ticket ).
The long and short of it is that when you attempt to find a specific `img` element by its `src` attribute, it works fine with normal selectors like this:
$("img[src='logo.png']"); // Works
$("#test > img[src='logo.png']"); // Works
However, when you combine it with a direct descendant selector, it fails:
$("> img[src='logo.png']", test); // Fails
$(test).children("img[src='logo.png']"); // Fails
Adjusting it to match the end of the `src` attribute causes it to work again:
$("> img[src$='logo.png']", test); // Works
$(test).children("img[src$='logo.png']"); // Works