Thursday, April 23, 2009

Using jQuery - Attributes 1

As I said before , selectors makes jquery powerful . In this post I want to write about attribute selector.
Its very easy ... here is a sample :
$("a[href='http://www.google.com']").
In this example $("a") select each link on the page , and [href='http://www.google.com'] restrict the selector to 'a' tags with href attribute equals to 'http://www.google.com' .

example :
I have a list of some files like below


If you want to show this list with appropriate icon for each type of file , you must add an img tag before each link . jquery has .before() and .after() method for insert content after and before selected tag(s) by selector.
Ok . Now I want to select each link in the page with href attribute ends with '.pdf' and insert an img tag befor using .before() method.



dont worry about $(document).ready . Its assign a function to onload event of document .




and now lets finish it ...



HTML result :


Monday, April 20, 2009

Using jQuery - Hide and Show Div

Write Less Do More .

In this post I'll show you how can hide and show a div using jquery.
First you should able to select your Div by jquery selectors.In this example I use the ID Selector .
Then Call .show() method to set display property of div from none to block , and .hide() to reverse it.




There is another way for this job , by using .toggle()  method your hidden div appears by first click and disappears by second click . you can use an optional parameter(speed)  by .toggle() method for animate your job . acceptable values for this parameter are "slow" , "fast" or a numeric value in millisecond . note that this optional parameter available for .show() and .hide() methods .

  

Wednesday, April 15, 2009

Google Solar Panel Project




what is a Solar Panel ?

Solar Panel is the array of Solar Cells and a solar cell is a device that convert sunlight directly into electricity.Solar cells are classified into tree generation.Solar cells are often electrically connected and encapsulated as a module. PV modules often have a sheet of glass on the front (sun up) side, allowing light to pass while protecting the semiconductor wafers from the elements (rain, hail, etc.). Solar cells are also usually connected in series in modules, creating an additive voltage. Connecting cells in parallel will yield a higher current. Modules are then interconnected, in series or parallel, or both, to create an array with the desired peak DC voltage and current.

The power output of a solar array is measured in watts or kilowatts. In order to calculate the typical energy needs of the application, a measurement in watt-hours, kilowatt-hours or kilowatt-hours per day is often used. (wikipedia)


Google's green-energy plan

Google complete solar energy project in June 2007 to flow the Google's green-energy plan . in this project thay committed to helping to build a clean energy future. Google's green-energy plan goes by the formula-like name RE>c , which sets out the goal of the company's operation -- to find renewable energy sources that reliably generate electricity more cheaply than burning coal.



Google installed 9212  solar panels at its Silicon Valley headquarters that will rank as the largest U.S. solar-powered corporate office complex . This is a 1.6MW solar system that produce about 8000 kilowatt-hours of electricity in 24 hours. This amount of electricity is enough to power 30% of Google's peak electricity demand in our solar powered buildings at our Mountain View, CA headquarters.


“This is the largest customer-owned solar electric system at a corporate site,” said Noah Kaye, director of public affairs at the Solar Energy Industries Association, an industry group based in Washington, D.C.




According to Robyn Beavers, the director of environmental programs at Google. Google intends to generate 50 megawatts of electricity from renewable forms for its operations by 2012.

What is jQuery ?

jQuery is the best JavaScript library that use to easy , fast and smart client side programing for web. javascript is a powerful client side scripting language , but nobody like it pure.
because its very difficult and need to spend a lot of time to do some works cool .

Using a good javascript library make it easy to scripting client side and make you sure that your scripts works currect on popular browsers like FireFox , Google Chrome and IE .

You can download last stable version of jQuery core here .

Using jQuery is very simple , you should just simply add a like to the jQuery.js file in your html document .

jQuery is designed to change the way that you write JavaScript.
One of powerfull futures of jQuery is selectors , here is a sample:

Traditional way:



 Using jQuery


I try to write some jQuery samples later .

more about gmail


I like google and also GMail because of making difference in performance and quality of service and I try to write about google products .

Know a little point about Gmail...
As you know gmail support dot character in email address .
My Email address have dot and some day I try to login to my email address without dot's and it work's .
you can try it your self now...