News for hackers. Stuff that matters.
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by sparkygoblue on Monday November 25, 2013 @12:11PM (#6795291)
Consider caching your element selectors like this:

var $image = $('#my-div img');

This way jQuery doesn't have to traverse the DOM more than once to select the element.

Also, I believe you can do all of your mousedown() event code in one block.

Edit: oops, upon further inspection, I see you are doing this all in the console. Caching the selector is still possible, but now I understand why you did the mousedown() event the way you did.

Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by carlsednaoui on Monday November 25, 2013 @02:43PM (#6796401)
Hi sparkygoblue, author here, thanks for the feedback! As you mentioned in your edit, I tried to break every step into simple-to-follow pieces.

Def let me know if you have any other suggestions :)

Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by jenius on Monday November 25, 2013 @11:46AM (#6795135)
+1 for the share button up top (https://github.com/carrot/share-button) - but adjust that hover color to blue or grey!

</shameless plug>

Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by carlsednaoui on Monday November 25, 2013 @11:52AM (#6795178)
hahaha, thanks Jeff, I'll change that on the next revision ;)
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by tsumnia on Monday November 25, 2013 @11:48AM (#6795148)
Nice! I actually used a horrible version of Street Fighter for my Intro to Programming course. We were learning conditionals, so I thought, "Why not teach them character selection and Event listeners?" A little confusing, but kept everyone interested.
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by carlsednaoui on Monday November 25, 2013 @11:52AM (#6795174)
That's really interesting. Mind sharing a link to it (if you have one)? Would love to check it out.
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by tsumnia on Monday November 25, 2013 @01:01PM (#6795650)
No link, but I'll clean it up and email you a copy.

Its hideous, the gif's animation continues to repeat itself because the steps to play a gif once in VB is way too complicated. However, we built an onscreen gamepad so clicking left and right moved the character. It uses 3 BG stages and 3 characters (Ryu, Guile, and Chun-Li). I'll also include a link to where I got the gif's and sound effects.

Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by carlsednaoui on Monday November 25, 2013 @01:59PM (#6796105)
Awesome, looking forward to it!
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by tsumnia on Monday November 25, 2013 @02:43PM (#6796396)
Since I figured someone else might like to use it, I added some comments and uploaded a copy to GitHub. Here you go: https://github.com/tsumnia/Visual-Basic-Street-Fighter
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by carlsednaoui on Monday November 25, 2013 @04:27PM (#6797168)
Awesome, thank you! Will check it out when I get home tonight.
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by 1337biz on Monday November 25, 2013 @11:45AM (#6795129)
Thank you! If I can make one suggestion it would be to add somewhat at the end a demo of the final project. The first thing I do with tutorials is always to scroll to the end and see what I am going to end up with.
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by carlsednaoui on Monday November 25, 2013 @11:47AM (#6795142)
Thanks for the suggestion 1337biz. If you scroll down to "Your First jQuery Project" you should see the example we're creating in the guide. Let me know if there's anything else.
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by hodgesmr on Monday November 25, 2013 @11:55AM (#6795194)
While I applaud the time the author took to write this, isn't the message a bit misguided? Wouldn't it be more useful to encourage people to "Learn JavaScript and how to read an API"?
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by carlsednaoui on Monday November 25, 2013 @11:58AM (#6795212)
Hi hodgesmr, author here. Could you expand a bit more on your comment, would love to hear your suggestions.
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by hodgesmr on Monday November 25, 2013 @12:03PM (#6795244)
I think the tutorial is nice and does a good job demonstrating the power that jQuery offers over plain old JS. But if a newcomer to web dev came across this, it seems to not relay the point of what jQuery is: a JavaScript library. IMO, "learning jQuery" is a rather abstract concept and in the grand scheme, developers would be better off spending time with plain old JavaScript and making themselves familiar with how to read the jQuery API. I know this sounds rather "RTFM" of me, but that's not quite what I'm going for.

Good job on the tutorial. But I hope new-comers will look for JavaScript references for future education.

Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by Cederfjard on Monday November 25, 2013 @12:05PM (#6795259)
I'm not able to scroll down the page on my iPad - it doesn't seem to hang, I just can't scroll. Any idea why?

Will definitely check it out when I'm on my laptop, seems cool!

Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by carlsednaoui on Monday November 25, 2013 @12:08PM (#6795275)
Hi Cederfjard, author here, the guide won't work on iPad (or mobile devices) :(

Let me know if you have any problems looking at it from your computer.

Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by alevans4 on Monday November 25, 2013 @12:30PM (#6795430)
What is the purpose of the opacity fade at the bottom? Stylistic? I'd really rather be able to see everything clearly. Looks like there is some good content otherwise.
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by MWil on Monday November 25, 2013 @02:54PM (#6796477)
I agree. It's more distracting than it is helpful, perhaps even just allowing more to be visible at a time.
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by nopeavi on Monday November 25, 2013 @01:46PM (#6796004)
Enjoyable read, but that share button was annoyingly as all hell. Easy enough to delete, though, as we were already in the web inspector.
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by adsr on Monday November 25, 2013 @12:36PM (#6795479)
Just wanted to mention that this console is available in Safari as well, presumably a consequence of webkit.
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by carlsednaoui on Monday November 25, 2013 @12:45PM (#6795547)
Thanks, author here, the reason I mention to use Chrome is to make sure the screenshots on the guide match what the user sees on their screen.
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by adsr on Monday November 25, 2013 @01:21PM (#6795794)
Ok I see, makes sense. Anyway, nice hands on tutorial, I like it. :) Thanks
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by libria on Monday November 25, 2013 @12:41PM (#6795523)
Really neat and approachable tutorial with clear goals. Effective instruction is difficult, so good work!
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by carlsednaoui on Monday November 25, 2013 @12:43PM (#6795538)
Author here, thanks so much!
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by t3hprofit on Monday November 25, 2013 @11:31AM (#6795027)
while it's a bit of a face dive into jQuery, this is amazing.
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by carlsednaoui on Monday November 25, 2013 @11:35AM (#6795064)
Author here, glad you enjoyed it :)

Definitely let me know if you have any feedback or suggestions.

Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by tachion on Monday November 25, 2013 @11:43AM (#6795110)
Hey, on Chrome 32.0.1700.19 beta this:

Use the keyboard shortcut Command: Option + J (Mac)

doesnt work, as the shortcut seems to be Option + Alt + J.

Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by carlsednaoui on Monday November 25, 2013 @11:46AM (#6795132)
Doh! Didn't know they changed it. Thanks for the heads up!

Did the menu access change? Or is it still View > Developer > JavaScript Console.

Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by tachion on Monday November 25, 2013 @11:49AM (#6795160)
Nope, that one worked, and this is how I figured out the proper shortcut ;)
Re:Intro to jQuery: Learn jQuery with Street Fighter and Had... by t3hprofit on Monday November 25, 2013 @02:52PM (#6796464)
cmd + option + i always worked for me on mac. never tried J.