smooth-scrolling


Smooth scroll function really slow


I have a script that is supposed to create a smooth scroll down the page when a link is clicked. It works well, but it seems to be very slow the first time it is run on the page. Any suggestions on how to clean this up?
Code
$(function() {
$('a[href*="#"]:not(.carousel-control)').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;
}
}
});
});

Related Links

Smooth scroll function really slow
Instagram snapwidget stops the smoothscroll
Listview SmoothScrollToPosition control with buttons and change item background
So smooth scrolling like on this website
One Page Scroll add Active class depending on scroll position
Smooth-Div-Scroll and iPad

Categories

HOME
qlikview
asp.net
service
windows-server-2008
conceptual
singleton
sdk
autocad
meson-build
coding-style
facebook-sharer
opengrok
react-select
responsive
web-testing
simd
ofbiz
jquery-easyui
draw2d
passbook
descriptor
git-branch
combinations
fibonacci
tcpdf
aws-certificate-manager
2checkout
drawrect
jmsserializerbundle
akamai
ios-autolayout
rtos
restler
dropdownbox
android-geofence
aweber
armadillo
aspose.pdf
delphi-xe
glide-image-library
irr
libzip
logan-square
denodo
evaluation
skype-bots
appcmd
hellosign
grib
lightspeed
stringbuilder
dimensionality-reduction
virtualenvwrapper
xcode7.1
change-password
angular-i18n
boost-propertytree
video-embedding
alchemy
computability
kramdown
magnet-uri
gitk
tokudb
backtrace
qxorm
quickfixn
information-hiding
fxmlloader
frisby.js
mind-manager
conditional-comments
im4java
xts
webshim
enquire.js
db2-connect
ie-developer-tools
tlbimp
octokit
ironworker
mandelbrot
pyxplot
select2-rails
nsautoreleasepool
cloudmade
simplemembership
django-tinymce
invalidoperationexception
mcpd
designated-initializer
norton
jquery-attributes
numerical-computing
content-delivery-network
j++
paperless

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App