Total members 11889 |It is currently Fri Mar 29, 2024 7:04 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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>




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  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     -  
 Control HR tag width and height     -  
 TCP Transmission Control Protocol     -  
 PC control by mobile Project     -  
 Control Directives usage PIC assembly     -  
 Curve Control Point in java     -  
 TEMPERATURE AND HEAT CONTROL Assembly     -  
 Control scroll speed using JQuery     -  



Topic Tags

JQuery Fade
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com