user3248595
user3248595

Reputation: 37

Scrollbar and Smooth Scrolling Code

Please check this page (for an example)

http://www.christinamichael.in/create-a-powerful-human-disintegration-effect-in-photoshop

I want to know how can i have such this ?

I want something to be supported in firefox and chrome .

Upvotes: 2

Views: 89

Answers (1)

Keyur Surani
Keyur Surani

Reputation: 36

You can do the smooth scrolling with use of ANCHOR tag. Below results.


$(function() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^//,'') == this.pathname.replace(/^//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); });

Upvotes: 1

Related Questions