This project is read-only.
Project Description
Linq to jQuery plugin came to support linq to jQuery objects and
proves easy support to jQuery functions.

So... where would I want to use it actually?!?
For example, lets say we got a list of divs, where each one got a certain
data value, and we want the ones with .data('mode') == 'big'
using normal jQuery we would need to do something like this:

  if($(this).data('mode') == 'big')

Pretty long for such a simple task no?, so how would we do it with linq?

//normal way:
//or a lambada string way
$('div').where('x=> == "big"').select().hide(); 

Basic Idea is from linq

//From each div, where height equels 50, select and hide

So the basic syntex is:
We can also shorten the from like this:


Ok awesome, lets say I want to do more complex stuff
for each object from those objects... do I need to use .each after
the select?, well, you can, but no...

var width = 0;
  width += $(this).width();

All cool, lets say I want to do everything which is
is bigger then 50 height..

//More Then
//Less Then
//More or Equels Then

Ok, Lets say you want something complicated which the where
function doesnt got, for example you want all items which got
opacity which is bigger then .5 AND height is bigger then 50px

  if($(this).css('opacity')>0.5 && $(this).height() > 50)
    $.addLinq(this); //Following function adds the item into our objects

Everything seems pretty cool, After you got the basic idea
We can move into the advanced stuff for our linq users
Lambada String!

//Getting all objects which .data('mode') bigger then 50
$('div').where('x => > 50').select().hide(); 

And of course, What about more complex linq functions, does it got them also?
Well, Some of them...

//Takes all the divs where text contains "Water", Reverse there order, Skips the First 5 and then Takes the first 2

And that is basicly it for now!
Note this is still Beta, and please note me for bugs / ideas
Docs still not up yet, soon I would upload them also so you would be able to see all the functions

Last edited Jun 4, 2010 at 8:30 AM by Itayeng, version 9