jQuery

jQuery 1.4.2 Released

Such quick turn around for the last two point releases are building my confidence in jQuery! I love to see the huge performance improvements, its almost becoming an issue to try and fit each release into our codebase at work. Love jQuery nonetheless… keep up the good work.

Relase notes: http://blog.jquery.com/2010/02/19/jquery-142-released/

Quick Summary:

Api Changes: http://api.jquery.com/category/version/1.4.2/

Tags: ,

Friday, February 19th, 2010 JavaScript, Programming, jQuery No Comments

Fun with jQuery – Checkboxes!!!

Another day with jQuery, this time we are talking about checkboxes. Just like I stated in my previous post about select boxes, jQuery and checkbox integration, if you will, isn't cut and dry but damn near close. So how can jQuery assist with checkboxes? Lots of ways, here are a few examples to keep you entertained. Try and manually select a checkbox and it will still toggle them correctly (turn them off it they are on and vice versa). [inline] [/inline]

jQuery selector for checkboxes

Just like any input you can choose your checkbox(es) with any standard selector.
  • By Class
    //Selector
    $('.cb_class')
    
    <!-- Input Html -->
    <input type="checkbox" class="cb_class" />
    
  • By Id
    //Selector
    $('#cb')
    
    <!-- Input Html -->
    <input type="checkbox" id="cb" />
    
  • By tag and attribute
    //Selector
     $('input[type=checkbox]')
    //Note: This would select all checkboxes
    //(same code in the Toggle Checks button above)
    
    <!-- Input Html -->
    <input type="checkbox" />
    
  • By tag and attribute
    //Selector
    $('input[name=checkBoxname]')
    
    <!-- Input Html -->
    <input type="checkbox" name="checkBoxname" />
    
› Continue reading

Tags: , ,

Saturday, October 17th, 2009 JavaScript, Programming, Quick Tips, jQuery No Comments

More jQuery Fun – Auto Populating a Select Box

Problem: You want to dynamically populate a select box and you don't know how. Solution: Easy, I will show you. First off, I lied there is no built in way in jQuery (why?, I don't know) to automatically populate a select box. But it actually is very easy. There are plenty of methods to accomplish this but I like to do it this was because utilizes the Option object and it doesn't require html string concatenation.

The basics

Example 1: Here is the code for the onlick event of that button: › Continue reading

Tags: ,

Thursday, October 15th, 2009 JavaScript, Programming, Quick Tips, jQuery 3 Comments

Fun with jQuery – toggle() – Easy tips to visually enhance your website

Here's a quick tip to add some cool effects with jQuery that require very little code to implement. In this example I'm going to so how use of the toggle function can make the simplest functionality and jazz it up.

.toggle()

In a nutshell, the toggle function will call the show() function if your element isn't visible and the hide() function if it is.
  • Hamburger
  • Philly Cheese Steak
  • Taco
  • Pizza
  • Something else greasy and unhealthy
<input onclick="$('#preview1').toggle();" type="button" value="Toggle My Menu" />
So as expected, clicking the button will toggle the menu. Now lets get a little more flashy: › Continue reading

Tags: ,

Wednesday, October 14th, 2009 JavaScript, Programming, Quick Tips, jQuery 1 Comment

Powered by Twitter Tools