Animate scrolling creates a better effect to the visitor than to just job to a place on the page.
STEP ONE : Specifying link
<a href="#section" >ANIMATE</a>
STEP TWO : Specifying the linked area
<div id="section"></div>
STEP THREE : Jquery code
<script >
$(document).ready(function() {
anchor();
});
function anchor () {
$("a").click(function(e){
var sectionid ="animatelink";
$("html body").animate({
scrollTop: $("#" + sectionid).offset().top
},1200
)})
}
</script>
$(document).ready(function() {
anchor();
});
function anchor () {
$("a").click(function(e){
var sectionid ="animatelink";
$("html body").animate({
scrollTop: $("#" + sectionid).offset().top
},1200
)})
}
</script>
EXAMPLE:
CLICK LINK TO SEE EFFECT ANIMATE
DOWN
DOWN
DOWN
DOWN
DOWN
DOWN
DOWN
DOWN
DOWN
DOWN
DOWN
DOWN
HERE (IIS THE DISTINATION
DOWMLOAD SOURCE CODE


No comments:
Post a Comment