Switch to full style
JQuery Examples
Post a reply

Fade-In, Fade-out and Fade-toggle with time control

Sun Dec 30, 2012 12:23 am

Control the speed of fading effects
Code:

<html>
<
head>
<
title>Fade-InFade-out and Fade-toggle</title>
<
script src="jquery-1.8.3.js"></script>
<script>
// Waits until the all document is loaded.
$(document).ready(function(){
 
 
  // fade-In elements with different speed.
 $("#fadeIn").click(function(){
  $("#fade1").fadeIn(2000);
  $("#fade2").fadeIn(500);
  $("#fade3").fadeIn(1000);
  $("#fade4").fadeIn(3000);
    
});
  // fade-Out elements with different speed.
   $("#fadeOut").click(function(){
   $("#fade1").fadeOut(900);
  $("#fade2").fadeOut(4000);
  $("#fade3").fadeOut(1000);
  $("#fade4").fadeOut(3000);
});
 // apply fade-toggle action with different speed.
   $("#toggle").click(function(){
   $("#toggle1").fadeToggle(3300);
  $("#toggle2").fadeToggle(3300);
 
});

}); 

</script>
</head>
<body>
  
  <p id="fade1">This paragraph includes part-one.</p>
  
  <p id="fade2">This paragraph includes part-two.</p>
   <input id="fade3" type="text"/>
  <p id="fade4">This paragraph includes part-three.</p>
  
   <p id="toggle1">This paragraph includes part-four.</p>
    <p id="toggle2"  hidden="true" >This paragraph includes part-five.</p>
  
  <button id="fadeIn">Fade-In</button>
  <button id="fadeOut">Fade-Out</button>
  <button id="toggle">Fade-Toggle</button>

</body>
</html>




Post a reply
  Related Posts  to : Fade-In, Fade-out and Fade-toggle with time control
 JavaScript fade out problem     -  
 Hide, show and toggle effects with speed control     -  
 Toggle the Multi Monitor Setting in Windows XP     -  
 TCP Transmission Control Protocol     -  
 PC control by mobile Project     -  
 Control HR tag width and height     -  
 Control font size of sub and sup text     -  
 Control Directives usage PIC assembly     -  
 Curve Control Point in java     -  
 TEMPERATURE AND HEAT CONTROL Assembly     -  

Topic Tags

JQuery Fade