I have a paragragh of text.
<p>
line1
line2
line3
</p>
intially all the text are red when a button is pressed each line's color changes to black gradually (2 sec each line)
can this be done with only jquery?
I have a paragragh of text.
<p>
line1
line2
line3
</p>
intially all the text are red when a button is pressed each line's color changes to black gradually (2 sec each line)
can this be done with only jquery?
Yes it can be done with jQuery but you will need the Color Animation plugin...
http://plugins.jquery.com/project/color
EDIT: Sorry mate this script should do it for you (you will need the color plugin still)
// Rename #go to the trigger that starts the animation
$("#go").click(function(){
var i = -1;
// Rename #container to the name of the element surrounding the p tags
var arr = $("#container p");
(function(){
if(arr[++i])
$(arr[i]).animate({ color: "#ff0000" }, 2000, "linear", arguments.callee)
})();
});