35 views
fadeTo effect will customize your fading according to your required opacity.
fadeTo( speed, opacity, [callback] )
speed-denotes speed of fadeIn either as {’slow’,'def’,'fast’} or in milliseconds as {2000}.
opacity-starts from 0 to 1.
callback- function that will be executed after each and every animation.
-
Example:
-
<style>
-
div { margin:3px; width:180px; display:none;
-
height:80px; float:left; background-color:red;}
-
span { margin:3px; text-align:left; color:white;}
-
</style>
-
<script type="text/javascript">$(document).ready(function(){
-
-
$(‘#start’).click(function(){
-
$("#div_box").fadeIn("slow",function recall(){
-
$(‘#span_content’).fadeTo("slow",1,function (){
-
$(‘#span_content’).fadeTo("slow",0.55);
-
-
-
recall();
-
});
-
});
-
});
-
$(‘#stop’).click(function(){
-
-
$(‘#span_content’).stop();
-
});
-
});
-
</script>
-
<body>
-
<a id="start" href="javascript:void(0)">Start</a> <a id="stop" href="javascript:void(0)">Stop</a>
-
<div id="div_box"><span id="span_content">computereducationworld</span></div>
-
</body>
-