Showing posts with label jquery. Show all posts
Showing posts with label jquery. Show all posts

Wednesday, August 26, 2009

Jquery API/1.3/Utilities

API/1.3/Utilities

From jQuery JavaScript Library

Jump to: navigation, search

Browser and Feature Detection:

Name

Type

jQuery.support

Returns: Object

Added in jQuery 1.3 A collection of properties that represent the presence of different browser features or bugs.

jQuery.browser

Returns: Map

Deprecated in jQuery 1.3 (see jQuery.support) Contains flags for the useragent, read from navigator.userAgent.

jQuery.browser.version

Returns: String

Deprecated in jQuery 1.3 (see jQuery.support) The version number of the rendering engine for the user's browser.

jQuery.boxModel

Returns: Boolean

Deprecated in jQuery 1.3 (see jQuery.support) States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model.

Array and Object operations:

Name

Type

jQuery.each( object, callback )

Returns: Object

A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.

jQuery.extend( deep, target, object1, objectN )

Returns: Object

Extend one object with one or more others, returning the modified object.

jQuery.grep( array, callback, invert )

Returns: Array

Finds the elements of an array which satisfy a filter function. The original array is not affected.

jQuery.makeArray( obj )

Returns: Array

Turns anything into a true array.

jQuery.map( array, callback )

Returns: Array

Translate all items in an array to another array of items.

jQuery.inArray( value, array )

Returns: Number

Determine the index of the first parameter in the Array (-1 if not found).

jQuery.merge( first, second )

Returns: Array

Merge two arrays together.

jQuery.unique( array )

Returns: Array

Remove all duplicate elements from an array of elements. Note that this only works on arrays of DOM elements, not strings or numbers.

Test operations:

Name

Type

jQuery.isArray( obj )

Returns: Boolean

Added in jQuery 1.3 Determine if the parameter passed is an array.

jQuery.isFunction( obj )

Returns: Boolean

Determine if the parameter passed is a Javascript function object.

String operations:

Name

Type

jQuery.trim( str )

Returns: String

Remove the whitespace from the beginning and end of a string.

URLs:

Name

Type

jQuery.param( obj )

Returns: String

Serializes an array of form elements or an object (core of .serialize() method).

Friday, May 29, 2009

How to Create A Sliding Panel with Jquery

We are going to show you a series of how to articles to create some jQuery effects with JavaScript in your web designs. In case you don’t know what jQeury is, it’s a JavaScript Library. It has heaps of Ajax and JavaScript components that will let you enhance your web design and the users experience on your site.

First you need to grab a copy of jQuery Grab the latest released mini(compressed) version.

How to get the elements you need.

Creating jQuery Functions is relatively easy thank to the great documentation. The main thing you have to know is how to get the exact element that you want to apply the effects to.

Example :


* $(”#header”) = get the element with id=”header”
* $(”h3″) = get all <h3> element
* $(”div#content .photo”) = get all element with class=”photo” nested in the <div id=”content”>
* $(”ul li”) = get all <li> element nested in all <ul>
* $(”ul li:first”) = get only the first <li> element of the <ul>

So with that in mind we are going to create our first jQuery effect. The commonly seen sliding panel, where you click a button and a panel slides up or down. Create a html document and call in the JavaScript file between the <head> tags along with you css file for styling. Then create two divs, one big one called <div id=”panel”></div> for the pannel and <div class=”btn-slide”></div> for the button. Style as you wish.

Then call is javascript into your page either inline, or by an external .js file.






When any element with in your html file is clicked, it will toggle the slide up and down of the <div id=”panel”> element and then toggle a CSS class=”active” to the <a class=”btn-slide”> element. The .active class will toggle the background position of the arrow image (by CSS).

what is jquery

jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

it's lightweight (just 19 kb in size) CSS3 complient and with cross browser support (IE 6.0+, FF 2+, Safari 3.0+, Opera 9.0+, Chrome and almost all the browsers).

you can download the latest release from here