Go fast in your desire section in a web page
If you want to add smooth scroll in your website something like as, you can add the Javascript code in your website.
View Demo.
By-Mofizul Islam
http://themepack.net
If you want to add smooth scroll in your website something like as, you can add the Javascript code in your website.
Linking To Specific Points on a Page
When we want to link to a specific point on a page, the standard tool that HTML provides is the named anchor. Here's how that works:
- At the destination point (e.g.
Contact form at the bottom of the page), we add a named anchor tag at the start of the section:a < name="contact"></a>a
This is an invisible element that doesn't appear to visitors in the browser. - To link to this point (e.g.
the top of the page), we link using the hash character (from #) and the name of the destination anchor:< href="#contact">Go To Contact Form</a>a
// Smooth scroll
$'a ( href*="#"] [ not : [href="#"])') ( click . function ( ) { (
(location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location if hostname == this . hostname) { .
target = $ var this ( hash); .
= target target length . ? target $ : '[name=' + this ( hash . slice . 1) +']'); (
(target if length) { .
$'html, body') ( animate . { (
: target scrollTop offset . ) ( top .
}, 1000);
false; return
}
}
});
View Demo.
By-
http://themepack.net
