/    Sign up×
Community /Pin to ProfileBookmark

adding ease-out to javascript

I know nothing about javascript. I want to add [B]easeOutSine[/B] to the following script. Can someone show me how/where to add it?

[CODE]<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js”></script>
<script>$(document).ready(function() {
function filterPath(string) {
return string
.replace(/^//,”)
.replace(/(index|default).[a-zA-Z]{3,4}$/,”)
.replace(//$/,”);
}
$(‘a[href*=#]’).each(function() {
if ( filterPath(location.pathname) == filterPath(this.pathname)
&& location.hostname == this.hostname
&& this.hash.replace(/#/,”) ) {
var $targetId = $(this.hash), $targetAnchor = $(‘[name=’ + this.hash.slice(1) +’]’);
var $target = $targetId.length ? $targetId : $targetAnchor.length ? $targetAnchor : false;
if ($target) {
var targetOffset = $target.offset().top;
$(this).click(function() {
$(‘html, body’).animate({scrollTop: targetOffset}, 500);
return false;
});
}
}
});
});</script>[/CODE]

Thank you!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@rootMar 23.2016 — You have posted a JQUERY question in the JavaScript forum, JQUERY is in the sub forum at the top of the JavaScript forum called "Frameworks" because that is what JQUERY is, a framework that is written in JavaScript, it is not JavaScript ?
Copy linkTweet thisAlerts:
@SempervivumMar 23.2016 — Read the docu of jQuery animate:

http://api.jquery.com/animate/

In order to user easeOutSine you will have to include jQuery-UI additionally:

https://api.jqueryui.com/easings/
Copy linkTweet thisAlerts:
@TrainMar 23.2016 — Moved to jQuery.
×

Success!

Help @jd523 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...