jQuery by Gurudath BN

jQuery Introduction

jQuery is a lightweight, “write less, do more”, JavaScript library.

The purpose of jQuery is to make it much easier to use JavaScript on your website.

jQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation.

The jQuery library contains the following features:

  1. HTML/DOM manipulation  
  2. CSS manipulation  
  3. HTML event methods  
  4. Effects and animations  
  5. AJAX  
  6. Utilities


The jQuery library is a single JavaScript file, and you reference to it using the HTML

<head>http://jquery.js</head>

There are two versions of jQuery available for downloading:  

  1. Production version : ­ This is for your live website because it has been minified and compressed .
  1. Development version :  This is for testing and development (uncompressed and readable code) .

Video link :- https://youtu.be/0FBRtM_azq0

Next post  will be soon. 

 

Animations using jQuery

animation-jquery-css
animation-jquery-css

The jQuery animate() method is used to create custom animations.

Syntax:

$(selector).animate({params},speed,callback);

params :- defines the CSS properties to be animated.
speed :- specifies the duration of the effect. It can take the following values: “slow”, “fast”, or milliseconds.
callback :- function to be executed after the animation completes.

animation Jquery

Example:

$(“button”).click(function(){
     $(“span”).animate({
        left: ‘250px’,
       opacity: ‘0.5’
    });
});

Using Relative Values

It is also possible to define relative values (the value is then relative to the element’s current value). This is done by putting += or -= in front of the value :

$(“button”).click(function(){
     $(“span”).animate({
        left: ‘250px’,
        height: ‘+=150px’
     });
});

Uses Queue Functionality

jQuery comes with queue functionality for animations.Which means that multiple animate() calls after each other, jQuery creates an “internal” queue with these method calls. Then it runs the animate calls ONE by ONE.

So, if you want to perform different animations after each other, we take advantage of the queue functionality:

$(“button”).click(function(){
       var span = $(“span”);
       span.animate({height: ‘300px’, opacity: ‘0.4’}, “slow”);
       span.animate({width: ‘300px’, opacity: ‘0.8’}, “slow”);
       span.animate({height: ‘100px’, opacity: ‘0.4’}, “slow”);
       span.animate({width: ‘100px’, opacity: ‘0.8’}, “slow”);
});

A sample example of using jQuery animation:

http://animation-jquery-css.bitballoon.com/

Jquery highlight search text plugin Gsearch on the webpage in a easy way.

hightlight search text jquery

Tiny, fast jQuery plugin to search text through elements as you type. This plugin is created and maintained by Gurudath BN ( Github ).

Features :-

  1. Lightweight. This plugin is only ~3.8kB minified and gzipped!
  2. Fast. This plugin is optimized for fast, lagless searching even through large element sets.
  3. Search types. This plugin provides search text ! Fuzzy matching, case insensitive also.
  4. Custom show/hide. You can define custom functions for showing and hiding the elements while searching.
  5. Provide a icon on hover textfield appear to search text , so it wont occupy space on page.
  6. Search anything. This plugin isn’t restricted to use on tables, any set of elements that has ‘rows’ with ‘columns’ inside them can be used.

Demo :-

Click here to view a demo of this plugin in action

https://jsfiddle.net/gurudath/k197zu3a/7/

Getting started :-

Basic usage  :-
U can know the basic workflow using the github url:-  https://github.com/gurudath/Gsearch

Git Path :- https://github.com/gurudath/Gsearch.git

Example usage :-

This example uses the configurations shown above to customize the plugin:

$(document).ready(function () {

       $(‘#update_stiky_search’).GSearch({

            update_at: ‘update_stiky_search’,

            margin_top: ‘100px’,

            background_color: ‘#01A9DB’,

            highlight_class: ‘highlight’,

            content_main: $(‘.main-content’)

        });

});