Neat examples. If I might make a couple of suggestions...?
Your page subtitle includes the word 'tutorial'. Personally, if I see that word I expect to be guided through the process of achieving each of the results in the examples. I would therefore suggest that, instead of having to go find the script and interpret it for oneself, it would be far more useful (to visitors) to display the code used for each example on the page itself. And either fully comment the script, or explain it step by step, so that people can understand what each bit does and possibly why. (The mechanism you choose to use to display the script code in itself be a further 'real world' example!) You have some quote Tom Foolery unquote in your script (example 3) for determining how to center a DIV. If the main purpose of the page is to demonstrate the power of jQuery, does that not also include its plugins/extensions, in this case specifically the dimensions plugin (which is an 'official' plugin, after all)? Also - and this is meant in the spirit of pushing jQuery, not as criticism of your code! - you might like to consider demonstrating the use of wrap() in place of some of your html string concatenations (examples 3 and 5)? And maybe make var p=$(this) in example 4, and use parent() and is() in the while loop? Also in example 4, if you use ...each(function(idx){... (as you do in example 1) you don't need to declare var idx or increment yourself. You have chained where possible, with the exception of examples 1 and 2 where blur() is not chained after focus() - any particular reason? hal10001 wrote: > > > Hello Everyone, > > I put this together over the last few days. I *might* consider it > advanced, and there is a lot of jQuery meat to it, so I figured I > would post it here first. If you find any bugs in the supported listed > of browsers, please let me know so I can fix them. I really wanted > these to be some "real-world" examples of the power of jQuery. I hope > they are helpful to the community at large. > > http://www.reindel.com/five_javascript_tricks_jquery > > I just have to also say that I absolutely love jQuery selectors! > > Brian > > > -- View this message in context: http://www.nabble.com/5-JavaScript-Tricks-Made-Easy-with-jQuery-tf4161166s15494.html#a11840681 Sent from the JQuery mailing list archive at Nabble.com.