Archive for jQuery
The Easiest Way to Select All Checkboxes with jQuery
After looking at many code samples online that were unnecessarily complex I’ve come up with my own simple method of selecting all checkboxes on a page:
$(":checkbox").attr("checked", true);
You can change the selector to target certain groups of checkboxes.
To deselect all checkboxes, simply change the “true” to “false”:
$(":checkbox").attr("checked", false);
Read morejQuery UI Datepicker Inline Select
It is well documented on the jQuery UI site on how to take a value from Datepicker when calling it from an input field. However when embedding Datepicker on a page (associating it with a div instead of an input field), you have to add a small amount of code to easily capture values from [...]
Read moreWordpress & jQuery: “$ is not a function”
If you are trying to add your own jQuery code to Wordpress, and have had the error “$ is not a function” show up on Firebug, here is the fix:
Convert all dollar signs ($) to ‘jQuery’
The dollar sign is reserved in Wordpress for the Prototype library, which is why it errors out. For example, instead [...]
Jcrop Large Image Previews
Jcrop is an excellent jQuery plugin developed by Deep Liquid. It is used to easily crop images on websites without having to use any photo editing software.
There is documentation on their website on how to use boxWidth and boxHeight to deal with large resolution pictures, however it does not tie together those methods with the [...]
