Defining your own functions in jQuery

יום שני, ספטמבר 22, 2008

Defining your own functions in jQuery. In this post i want to present how easy define your own functions in jQuery and using them. As you know, jQuery it's a very rich JavaScript library and it's a pity not to use all it resources. Ok. Do you want to create your own jQuery function to work with elements look like this: $(element).yourfunctionname() What is your steps to define it? At first, define "jQuery.fn" and add to this object your function name see below. (jQuery.fn is a prototype of jQuery object) jQuery.fn.yourfunctionname = function() { var o = $(this) // It's your element}; Now you...
תגיות: , , ,
22 תגובות

jQuery.create() – jQuery plugin to create HTML elements

יום חמישי, אוגוסט 21, 2008

jQuery.create() - it's a featured plugin for jQuery JavaScript Library. You can create any types of HTML elements, set attributes and context or HTML using jQuery.create(). See below the HTML example declaration. I think it make easy and fast your programming in JavaScript. jQuery.create = function() { if (arguments.length == 0) return ; var args = arguments || {}, elem = null, elements = null; var siblings = null; // In case someone passes in a null object, // assume that they want an empty string. ...
תגיות: , , , ,
26 תגובות

JavaScript Repeater Control (dataRepeater) – from jQuery.Presenter.1.0.8 – UIControls Library

יום רביעי, אוגוסט 20, 2008

In this post, I want to present a new JavaScript Repeater Control from my latest UIControls Library jQuery.Presenter 1.0.8. This control like (ASP.NET Repeater Control) created using jQuery Library 1.2.3 and support for later versions. It's a free open source script... Enjoy... /* * jQuery.Presenter 1.0.8 * Author: (basil.goldman@gmail.com) * Description: developed and tested on jQuery 1.2.1, * support and fixes for jQuery 1.2.6 */jQuery.fn.presenter = function() { if (arguments.length == 0) return ; var args = arguments || {}; // Global arguments var controlType = args.controlType; ...
10 תגובות