I am using Jquery to highlight a span of text when a trigger is clicked.
I am looking for a way to have the text highlighted from left to right, instead of all in one go, to give a "real" feel - so that it looks like it's being highlighted by hand.
I can't find any documentation about this online.... Any ideas?
Here is the code:
(HTML)
The Law of Universal Gravitation is based on the observed fact
that all masses attract all other masses. The force of
<span id="to_highlight">attraction decreases as the distance
between the masses increases.</span>
(JQuery)
if (count==4) {
$('#to_highlight').css("background-color","#e8c5e8");
};