Senin, 07 Mei 2012

Jquery Beginning Lesson 1


Actually what is interesting about JQuery? In addition to its use typed using a keyboard, a complete library, manual and tutorial are berjibun much on the internet, plugin was quite a lot, for those of you that deadline may be directly opened http://www.jqueryplugins.com jquery to get the desired effect . While for the present article the author will only specialize learn jquery from the bottom instead to use jquery plugin.

For this article the author will begin the discussion of the foundations of jquery, which started with Jquery Selector.

Why jquery can create effects that are so riveting, so that makes an HTML playing so highly interactive website? One reason is the use of a simple selector. What actually selector? Jquery selector concepts have practically adopted the concept of selectornya CSS. There id selector, class selector, and the tag selector. Confusing? Tell me about you. Better direct our course to practice freefall jquery. How?

The first thing we do is first download JQuery, you can visit http://docs.jquery.com/Downloading_jQuery to directly download it, or it can also click on this link http://code.jquery.com/jquery-1.4.2 . js the same. I'm not trying to fool you. : D. Okay, put the example file in c: belajarjqueryjquery-1.4.2.js. Done? Continue! The sooner the better.

Okay, then prepare a single html file, and put a directory with jquery-1.4.2.js that we downloaded earlier. Give the name for example, latihan.selector1.html

Then fill in the body such as this:

<p> liberal People say the movement to unite the Muslims around the world under the auspices of Al-Khilafah was a dream. Too utopian. ? Where can!!?, Said Abdul Mosqid mang.
Strange and wonder? surprisingly beautiful dream like this why not let tuk tetep there. Even forbidden-forbidden. Bin mahfuz it's weird name. A little bit forbidden? a little bit forbidden. Banned why a little bit. Haha! Which again makes me curious why so jealous of their struggle (those liberal college martial arts) in a close echo of Islamic sharia enforcement efforts through various media. Al-Quran ngoprek event together was so everyday activities. Ngopreknya not half-hearted, Al-Quran dicocokkin with their own reason, which does not fit criticized, reviled. Hahaha! cool-cool? Continue, if enforcement of Islamic sharia is practically just a dream doang, JIL Why should nerbitin islamlib.com rich media, with a single institutenya mang Gus Dur, and various other media are openly trying to alienate the people of Islam from Islamic Shari'a enforcement echo? and even not infrequently they actually melencengkan meaning and significance sebenarya Islamic Shari'a. I wonder deh. Does not surprise loh? What's behind all this? What on earth? What is it indeed ulil groaned, moaned? Haha ...
</ P>
<div id="kotakkotaknora"> </ div>
href = click click ... </ a>

Then we insert this script in the head:

<script type="text/javascript" src="jquery-1.4.2.js"> </ script>
<script type="text/javascript">
$ ("Document"). Ready (function () {
$ ("A"). Click (function () {
$ ("P.kalimat"). Css ("color", "red");
$ ("# Kotakkotaknora"). AddClass ("red");
});
});
</ Script>
<style type="text/css">
. Red {
height: 200px;
width: 200px;
background-color: red;
}
</ Style>

Okay, how? still confused? Let us discuss has JavaScript. First we call the jquery library,

<script type="text/javascript" src="jquery-1.4.2.js"> </ script>

Not to question why it exists. What? Yes, because how can we use our facilities without jquery jquery insert into the head tag. Okay we go.

<script type="text/javascript">
$ ("Document"). Ready (function () {
$ ("A"). Click (function () {
$ ("P.kalimat"). Css ("color", "red");
$ ("# Kotakkotaknora"). AddClass ("red");
});
});
</ Script>

When the html page has fully loaded
$ ("Document"). Ready (function () {

And when the selector tag? A? on the web page at the click
$ ("A"). Click (function () {

Change the sentence that is in the tag selector, class selector p to be equal to the sentence in red
$ ("P.kalimat"). Css ("color", "red");

Then give style to kotakkotaknora id selector.
$ ("# Kotakkotaknora"). AddClass ("red");

Cover.
});
});

So that should be noted is, to call the element which has id, for example, he has a div element id, then jquerynya call with selector # id.
So <div id="kotakotaknora"> </ div> on the call by jquery with $ ("# kotakkotaknora").

So even as a class in css, for example <p class="kalimat?> </ p>

And the last is the tag selector, for example href = because he did not have a class id and then calling the jquery $ ("a").

Easy huh? Okay we deepened again for the next tutorial.

The full script is like this, or can be downloaded here

<! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.0 Transitional / / EN">
<html>
<head>
<title> </ title>
<meta name="" content="">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script type="text/javascript" src="jquery-1.4.2.js"> </ script>
<script type="text/javascript">
$ ("Document"). Ready (function () {
$ ("A"). Click (function () {
$ ("P.kalimat"). Css ("color", "red");
$ ("# Kotakkotaknora"). AddClass ("red");
});
});
</ Script>
<style type="text/css">
. Red {
height: 200px;
width: 200px;
background-color: red;
}
</ Style>
</ Head>
<body>
<p> liberal People say the movement to unite the Muslims around the world under the auspices of Al-Khilafah State Daulah Islamiyah was a dream. Too utopian. ? Where can!!?, Said Abdul Mosqid mang.
Strange and wonder? surprisingly beautiful dream like this why not let tuk tetep there. Even forbidden-forbidden. Bin mahfuz it's weird name. A little bit forbidden? a little bit forbidden. Banned why a little bit. Haha! Which again makes me curious why so jealous of their struggle (those liberal college martial arts) in a close echo of Islamic sharia enforcement efforts through various media. Al-Quran ngoprek event together was so everyday activities. Ngopreknya not half-hearted, Al-Quran dicocokkin with their own reason, which does not fit criticized, reviled. Hahaha! cool-cool? Continue, if enforcement of Islamic sharia is practically just a dream doang, JIL Why should nerbitin islamlib.com rich media, with a single institutenya mang Gus Dur, and various other media are openly trying to alienate the people of Islam from Islamic Shari'a enforcement echo? and even not infrequently they actually melencengkan meaning and significance sebenarya Islamic Shari'a. I wonder deh. Does not surprise loh? What's behind all this? What on earth? What is it indeed ulil groaned, moaned? Haha ...
</ P>
<div id="kotakkotaknora"> </ div>
href = click click ... </ a>
</ Body>
</ Html>