I have a web page and for internal links I want to emphasis where the visitor jump after clicking on an internal link on current page. It is just like SO's comment or answer notification. First the target's background will be orange then it will smoothly turn back to white.
I could have done this but color change is not smooth.
HTML part
<a href="#section1">go to section 1</a>
<a href="http://google.com">Google</a>
<a name="section1"><a><h3 id="section1">Section 1</h3>
jQuery part
$(function () {
$("a[href^='#']").click(
function () {
var $id = $(this).attr("href");
$($id).css({"background-color":"#cc7733", "transition":"background-color"});
setTimeout(function () {
$($id).css("background-color", "#ffffff");
}, 2500);
});
});
JS Fiddle is here