Archive for December, 2007
On Holiday!
Merry Christmas to you all! I am on holiday until after New Years, so I won’t be posting any new tips!
If you have a tip or news item that you want to share on jQuery minute, please drop me a line at tip-time at the jqueryminute domain dot com.
Cheers!
-Jonathan
Wildcard ID’s – Select by ID and Filter
Here’s a solution for selecting elements by ID and running a regex to filter the results:
$(‘*[@id]‘).filter(function() {
var regex = /^regularExpressionToMatchIdsAgainst/;
return ( $(this).attr(‘id’).match(regex) !== null );
})
jQueryForDesigners.com Launched
Remy Sharp (no relation) has launched jQuery For Designers. Be sure to check it out and start participating!
jQuery 1.2.2 beta released
As from the jquery-dev google groups, jQuery 1.2.2 is in beta stage:
John Resig’s Beta Release Post -
Get jQuery 1.2.2b.js
Be sure to read John’s Post about how to test and submitting bugs!
Plugin Namespace
This recently came up again on the jquery-en Google Groups list, here’s a way that you can namespace your plugin.
http://www.nabble.com/Re%3A-passing-this-p13540912s27240.html
addClass() removeClass()
If you have to add or remove multiple classes with jQuery, the most efficient way is to separate the classes with a space and make one call.
Such as:
1 | $('body').addClass('abc def'); |
As opposed to:
1 | $('body').addClass('abc').addClass('def'); |
jQuery Documentation – Windows CHM Reference Manual
Picked up from the jquery-en Google Groups, here is a Windows CHM Help file version of the jQuery documentation.
http://charupload.wordpress.com/2007/12/07/jquery-documentation-chm/
Calculate Browser’s Scrollbar Width
Here’s a solution for calculating the brower’s scrollbar width. Tested in Internet Explorer 6 & 7, Firefox 1.5+ and Safari.
Welcome!
Greetings, I’m Jonathan Sharp and first coined the term “jQuery Minute” in this discussion thread on the Google Groups mailing list. jQuery Minute refers to how easy jQuery makes JavaScript for your web development tasks.
This site is aimed at providing quick tid-bits of code and “hidden” features of the jQuery library as well as highlight some neat plugin’s and uses of jQuery.