Jquery

JQUERY

0  0 2016-08-05 07:45:37

What is jQuery

jQuery is JavaScript library as written in javascript language.
As jQuery is cross-platform used in many browser. jQuery is "write less do more" used for advance effects.
jQuery simplifies AJAX call and DOM manipulation for the new style.
jQuery was first released in January 2006 by John Resig. It is currently headed by Timmy Wilson.
Nowadays, jQuery is widely used technology. Most of the websites are using jQuery.
jQuery is developed by Google. To use, you need to use JavaScript file for jQuery. You can download the jQuery file from jquery.com. in jQuery example, we are using the absolute URL of jQuery file as source. The jQuery is written inside the script tag.

Example no 1
<!DOCTYPE html>  
<html>  
    <head>  
         <title>First jQuery Example</title>  
         <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">  
         </script>  
         <script type="text/javascript" language="javascript">  
             $(document).ready(function() {  
             $("p").css("background-color", "cyan");  
             });  
         </script>  
     </head>  
    <body>  
        <p>The first paragraph is selected.</p>  
        <p>The second paragraph is selected.</p>  
        <p>The third paragraph is selected.</p>  
    </body>  
</html>  

Example no.2
<!DOCTYPE html>  
    <html>  
        <head>  
         <title>First jQuery Example</title>  
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">  
         </script>  
         <script type="text/javascript" language="javascript">  
             $(document).ready(function() {  
             $("p").css("background-color", "pink");  
             });  
         </script>  
     </head>  
    <body>  
        <p>This is first paragraph.</p>  
        <p>This is second paragraph.</p>  
        <p>This is third paragraph.</p>  
    </body>  
</html>  

Output:
The first paragraph is selected.
The second paragraph is selected.
The third paragraph is selected.
jQuery enables to add effects on a web page. jQuery effects can be categorized into fading, sliding, hiding or showing and animation effects.
The jQuery hide() method is used to hide the selected elements.

Syntax:
1.    $(selector).hide();  
2.    $(selector).hide(speed, callback);  
3.    $(selector).hide(speed, easing, callback);  
speed: It is an optional parameter of jquery. It specifies the speed of delay. It’s possible vales are slow, fast and milliseconds etc.

easing: It specifies the easing function to be used for transition effect.

1.    <!DOCTYPE html>  
2.    <html>  
3.    <head>  
4.    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>  
5.    <script>  
6.    $(document).ready(function(){  
7.        $("#hide").click(function(){  
8.            $("p").hide();  
9.        });  
10.    });  
11.    </script>  
12.    </head>  
13.    <body>  
14.    <p>  
15.    <b>This is a little poem: </b><br/>  
16.    Twinkle, twinkle, little star<br/>  
17.    How I wonder what you are<br/>  
18.    Up above the world so high<br/>  
19.    Like a diamond in the sky<br/>  
20.    Twinkle, twinkle little star<br/>  
21.    How I wonder what you are  
22.    </p>  
23.    <button id="hide">Hide</button>  
24.    </body>  
25.    </html>  

 

 

Comments (0)

Post Your Comments

Headquarter



Hong Kong Office



Find Us On

Ziuby
Ziuby