Posts by ramblingwood

9 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
ramblingwood says
In item #1, wouldn’t this: var testText = $('div#test').text();

Perform better if written like this? var testText = $('#test').text();

The initial declaration means jQuery will collect and loop through all the DIVs in the page looking for the one with the ID of “test”, whereas the revised declaration will simply get the element that has the ID of “test”, right?

Thanks, Atg

I don’t know, but I would imagine that jQuery is optimized enough to detect that because it is a large time savings.

9 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
ramblingwood says
@aaronworks I don’t see how a generic Javascript book would cover things specifically about jQuery.

@ramblingwood When I bought the book (and yes, I BOUGHT the book), I thought it would be just a generic book on JavaScript too. But I was nicely surprised that the author decided to devote a large part of the book to using jQuery. He thinks jQuery is the most accessible cross-browser framework whose syntax is easy to learn and use. I think this book provides a great foundation for delving into the actual jQuery site, as well as introduced me to a lot of useful jQuery plugins. So much so, I also bought the PDF version as a portable reference.

But your article also provides good learning points for the new jQuery programmer to keep in mind.

Oh! That’s great! The title led me to believe otherwise, but I didn’t Google it either. Interesting. I might borrow the book from the library.

9 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
ramblingwood says
I enjoyed the article. There is something that I lack understanding of in the Javascript. Could you point out what is the mechanical or programmatic connection when the pointer is moved off the links? I was expecting to see a function name like onHoverOff, or something of that nature. I don’t see how the script know what function to execute when the cursor moves off the links. Thanks!
In Javascript it is onmouseout . In jQuery, it is the the second argument in click. Example:
$('#something').click(function () {
// onmouseover
}, /* second argument!! */ function () {
// onmouseout
});
So, is this an example of the dreaded call back function?

No, a callback function is usually a function that is run after completion of code, where as this is just and argument to the method ‘click’.

9 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
ramblingwood says
I enjoyed the article. There is something that I lack understanding of in the Javascript. Could you point out what is the mechanical or programmatic connection when the pointer is moved off the links? I was expecting to see a function name like onHoverOff, or something of that nature. I don’t see how the script know what function to execute when the cursor moves off the links. Thanks!
In Javascript it is onmouseout . In jQuery, it is the the second argument in click. Example:
$('#something').click(function () {
// onmouseover
}, /* second argument!! */ function () {
// onmouseout
});
9 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
ramblingwood says

I completely agree, but unfortunately I wrote this so long ago, all I can imagine is that I changed two things and once and assumed that was the fix to whatever problem I was having.

One could write a whole tutorial on an in depth explanation of the finer workings of the animation method in jQuery, and I didn’t feel it was the time, the place and I didn’t really have much space because I didn’t want the tutorial to be too long.

9 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
ramblingwood says

@aaronworks I don’t see how a generic Javascript book would cover things specifically about jQuery.

@brainarn I have experienced the problem with the relative animations hanging also, and this article didn’t really cover that. It covered a build-up of animation experienced when the queue is followed (demo here: http://themeforest.s3.amazonaws.com/128_jquery/demo/demo_1.html ). The only way I have gotten around the relative animations hanging is finding the original left padding, and then on the animation back, use that absolute reference. It doesn’t really solve the problem, but it works and isn’t that hard to do.

I see what you are talking about on line 21. I had some good reason for that when I wrote this 5 weeks ago, but I can’t remember what that was.

9 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
ramblingwood says
An ok post – but please find someone to proofread before you post. It would be much more easily followed if thoughts flowed from one subject to the other easily, subjects and objects of sentences were obvious and words were not overused in the same sentence and spelled correctly. Your otherwise good points were quite difficult for me to ferret out.

So, my information about jQuery was correct and useful, but it had many English errors, causing readability issues?

It was proofread. I must go speak with that proofreader. He has always served me well on my long essays, maybe this is over his head.

If you don’t mind, would you point out some of the issues, because I would love to revise it to make it more clear for others. I would like to say that for some reason, many linebreaks were randomly added, and in some cases removed, which for me is severely affecting readability. Also, some code snippets were not properly encoded.

@justinrains I agree, but that is browser specific and not jQuery.

9 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
ramblingwood says

I’m actually the author of the post, but it doesn’t show me as such for some reason…

@themolitor Yeah, that was one of the most confusing things for me when I started with jQuery.

@Hleb No problem, happy to share.

9 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
ramblingwood says

Thanks for posting that!

by
by
by
by
by
by