welcome to XRM blog

Keep in touch with latest CRM/ERP articles

To remain competitive your organisation must be efficient across the business process spectrum. To do so you need to take sound decisions based on a balance between the cost and risk. To do so you will be heavily dependent on your content management in itself needs...

image
Blog

Some Important Jquery Effects

By Rajesh on 3/2/2014

These are the following Jquery Effects

1. Hide()/ Show()
2. FadeIn()/FadeOut()/FadeTo()
3. Toggle()
4. Slide()
5. Animation()

6. Stop()

7. Chaining

With the help of hide & show function of jquery we can hide and show any html element.

<html>
<head>
<script src="jquery.min.js">
script>
<script>
$(document).ready(function(){
  $("#btn").click(function(){
    $("#text").toggle();
  });
});
script>
head>
<body>
<p id="text1">Toggle Examplep>
<input type="button" id="btn" value="Click"/>
<p id="text">Toggle This Textp>
body>
html>

1. Hide()/Show():

 

                       Fig 1.

 

<html><head>
<title>title>
<script src="jquery.min.js">
script>
<script>
$(document).ready(function(){
  $("#btnhide").click(function(){
    $('#textp').hide();
  });
  $("#btnshow").click(function(){
    $('#textp').show();
  });
});
script>
head>
<body>
<div id="textp" style="width:180px;height:180px;display:none;background-color:blue;">div>
<input type="button" id="btnhide" value="Hide Text !"/>
<input type="button" id="btnshow" value="Show Text !"/>
body>
html>


                     Fig 2.


 
This is the example of show() function of jquery. if we click on Show text Button then we show the division.


                     Fig 3.
 
This is the example of hide() function of jquery. if we click on Hide text Button then we Hide the division.
2. FadeIn()/FadeOut()/FadeTo() :


                      Fig 4.
 
This is the example of FadeIn() function of jquery. if we click on FadeIn Button then we FadeIn to the following  division.

                      Fig 5.
 
This is the example of FadeOut() function of jquery. if we click on FadeOut Button then we FadeOut to the following  division.

 

<html>
<head>
<script src="jquery.min.js">
script>
<script>
$(document).ready(function(){
  $("#btnfadeIn").click(function(){
 
    $("#divfirst").fadeIn();
    $("#divsecond").fadeIn("slow");
    $("#divthird").fadeIn(3000);
  });
    $("#btnfadeout").click(function(){
    $("#divfirst").fadeOut();
    $("#divsecond").fadeOut();
    $("#divthird").fadeOut();
  });
});
script>
head>
 
<body>
<p>Use FadeIn And FadeOut Function()p>
<input type="button" id="btnfadeIn" value="Click For Use FadeIn Function()"/>
<input type="button" id="btnfadeout" value="Click For Use Fadeout Function()"/>
<br><br>
<div id="divfirst" style="width:180px;height:180px;display:none;background-color:green;">div><br>
<div id="divsecond" style="width:180px;height:180px;display:none;background-color:red;">div><br>
<div id="divthird" style="width:180px;height:180px;display:none;background-color:blue;">div>
 
 
body>
html>

FadeTo():

 

                                                    Fig 6.
 
This is the example of FadeTo() function of jquery. if we click on FadeTo Button then we FadeTo to the following  division.

 

<html>
<head>
<script src="jquery.min.js">
script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $("#divfed1").fadeTo("slow",0.14);
    $("#divfed2").fadeTo("slow",0.5);
    $("#divfed3").fadeTo("slow",0.6);
  });
});
script>
head>
 
<body>
<p>Exmp. fadeTo() p>
<button>Click to fadeTo boxesbutton>
<br><br>
<div id="divfed1" style="width:90px;height:90px;background-color:yellow;">div><br>
<div id="divfed2" style="width:90px;height:90px;background-color:black;">div><br>
<div id="divfed3" style="width:90px;height:90px;background-color:red;">div>
 
body>
html>

3. Toggle():

 

                                                   Fig 7.
 
This is the example of Toggle() function of jquery. if "This Toggle Text" is showing and if we click on Toggle Button then "This Toggle Text" is become Hide. if "This Toggle Text" is hide and if we click on Toggle Button then "This Toggle Text" is become show.

if we use toggle() function of jquery then we can hide and show any html element on single button click 

4. Slide() :
I. slideDown()
II. slideUp()
III. slideToggle()
These are The Following Three Function() we can slideUp, slideDown, slideToggle division
with these slide function.

<html>
<head>
<script src="jquery.min.js">
script>
<script>
$(document).ready(function(){
  $("#flip").click(function(){
    $("#panel").slideToggle("slow");
  });
});
script>
  
<style type="text/css">
#panel,#flip
{
padding:5px;
text-align:center;
background-color:#e5eecc;
border:solid 1px #c3c3c3;
}
#panel
{
padding:50px;
display:none;
}
style>
head>
<body>
  
<div id="flip">Click to slide the panel down or up Paneldiv>
<div id="panel">Hello world!div>
 
body>
html>

5. Animation() :

 

                                                      Fig 8
 
After Click on Animation Button we get some animation in our html  elements.
 

                          Fig 9

By using Animation() Jquery Function then we can animate Html elements.

 

<html>
<head>
<script src="jquery.min.js">
script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $("div").animate({left:'350px'});
  });
});
script>
head>
  
<body>
<button>Animation Clickbutton>
 
<div style="background:red;height:150px;width:150px;position:absolute;">
div>
 
body>
html>

6. Stop() :

With the help of stop() function of jquery we can stop slide of division.

 

<html>
<head>
<script src="jquery.min.js">
script>
<script>
$(document).ready(function(){
  $("#text2").click(function(){
    $("#text1").slideDown(5000);
  });
  $("#stop").click(function(){
    $("#text1").stop();
  });
});
script>
  
<style type="text/css">
#text1,#text2
{
padding:5px;
text-align:center;
background-color:red;
border:solid 1px #c3c3c3;
width:300px;
}
#text1
{
display:none;
width:300px;
height:150px;
}
style>
head>
<body>
<button id="stop">Click for Stop slidingbutton>
<div id="text2">Click here to slide down paneldiv>
<div id="text1">Welcome !div>
body>
html>

 

7. Chaining :

 

<html>
<head><script src="jquery.min.js">
script>
<script>
$(document).ready(function()
  {
  $("button").click(function(){
    $("#p11").css("color","yellow").slideUp(1500).slideDown(1500);
  });
});
script>
head>
<body>
 
<p id="p11">Example of Chainingp>
<button>Clickbutton>
 
body>
html>

 

 

Javascript
HTML 5
JQuery
Author
Blog Calendar
Blog Calendar List
2018 Nov  26  3
2018 Oct  7  3
2018 Sep  13  11
2018 Aug  2  2
2018 Jun  11  1
2018 Jan  41  2
2017 Sep  348  5
2017 Aug  14  1
2017 Jul  15  2
2017 Jun  36  2
2017 May  17  1
2017 Apr  31  2
2017 Mar  104  4
2017 Feb  269  4
2016 Dec  171  3
2016 Nov  267  8
2016 Oct  197  10
2016 Sep  341  6
2016 Aug  38  1
2016 Jun  1580  6
2016 May  102  3
2016 Jan  68  2
2015 Dec  373  6
2015 Nov  3  1
2015 Oct  11  1
2015 Sep  1105  6
2015 Aug  10  1
2015 Jul  101  2
2015 Jun  7  1
2015 May  20  1
2015 Apr  21  2
2015 Mar  67  3
2015 Jan  4998  4
2014 Dec  14  1
2014 Nov  2159  4
2014 Oct  74  2
2014 Sep  95  2
2014 Aug  2848  1
2014 Jul  40  2
2014 Apr  2401  12
2014 Mar  268  19
2014 Feb  216  8
2014 Jan  1490  16
2013 Dec  21  2
2013 Nov  607  2
2013 Oct  239  3
2013 Sep  10  1
2013 Aug  29  3
2013 Jul  202  1
2013 Apr  43  6
2013 Mar  1634  10
2013 Feb  272  4
2013 Jan  244  2
2012 Nov  24  2
2012 Oct  394  10
Tag Cloud
Interested in our services? Still not sure about project details? get a quote