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
logging
internet-explorer
repository
gcc
intellij-idea
pyspark
x509certificate
liquidsoap
ios-universal-links
ldap-query
guidewire
jetbrains
expo
yui
dat.gui
gpo
monad-transformers
ajaxcontroltoolkit
infinite-loop
android-wear-2.0
suitescript
smart-device
checkmarx
units-of-measurement
osgi-bundle
javapns
deferred
tikz
ng2-bootstrap
directions
availability
sdl-2
scip
rtsp
ssdp
rexx
synchronized
qtwebkit
hdpi
px4
playframework-2.3
htop
selection-sort
liferay-ide
lightspeed
eclipse-mars
access-violation
x12
settext
jspx
key-value-store
razorengine
jmh
datamodel
clear
controlpanel
sdkman
javapackager
om
pushwoosh
avrcp
autopep8
cl.exe
google-experiments
nsq
drools-guvnor
aiff
growl
api-eveonline
vundle
powerpoint-2010
windows-search
fscanf
yandex-api
sigma-grid-control
azure-caching
google-oauth-java-client
cab
typography
azure-scheduler
simplemembership
vline
gssapi
m3u
esi
expresso-store
doxia
custom-cursor
erlide
socketasynceventargs
scsf
cgaffinetransform
windows-xp-embedded
norton
lgpl
table-valued-parameters
httpbrowsercapabilities
tracd

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