Popular
Newest
Updated
Sign in
Create an account
Categories
Admin Templates
204
Multipurpose Templates
164
Landing Pages
157
Portfolios & Resumes
86
Ecommerce
46
Blogs & Magazines
26
Directories & Listings
26
UI Kits & Website Builders
10
Documentation
5
Specialty
106
Topics
General
277
Business & Corporate
122
Design & Creative Services
114
Apps & Software
54
Retail & Shopping
35
Startups & SaaS
27
Marketing & Conversion
21
Restaurants & Cafes
17
Education & Learning
16
Finance & Accounting
16
See all →
Compatible with
Bootstrap
776
Tailwind CSS
46
PHP
42
React
42
Laravel
26
Python
24
Angular
23
Vue.js
22
Django
20
ASP.NET Core
14
See all →
Discussion on
CloudArena - Online Service Theme
Details
Discussion
Back to discussions
Showing 1 – 1 of 1 replies
←
1
→
Love this theme. I'm trying to get […]
Mathias
PURCHASED
8 years ago
Hi,
Love this theme. I'm trying to get smooth scrolling between internal anchors on the same page working. Any tips on how to get this working?
-Matt
Reply
tomaj
SELLER
8 years ago
Hi
Here is simple javascript code which makes smooth scroll between internal anchors - just add it to 'assets/js/_app.js' (or inline as a script in your HTML file):
$('.js-scroll').on('click', function(e) {
e.preventDefault();
var target = this.hash;
$target = $(target);
$('html, body').stop().animate({ 'scrollTop': $target.offset().top}, 500);
});
In your HTML add anchor:
<a class="js-scroll" title="#" href="#demo">Demo</a>
and element with the same ID as in anchors href - "demo":
<div id="demo">
Demo element.
</div>
Reply
Close
Love this theme. I'm trying to get […]
Love this theme. I'm trying to get smooth scrolling between internal anchors on the same page working. Any tips on how to get this working?
-Matt
Here is simple javascript code which makes smooth scroll between internal anchors - just add it to 'assets/js/_app.js' (or inline as a script in your HTML file):
$('.js-scroll').on('click', function(e) {
e.preventDefault();
var target = this.hash;
$target = $(target);
$('html, body').stop().animate({ 'scrollTop': $target.offset().top}, 500);
});
In your HTML add anchor:
<a class="js-scroll" title="#" href="#demo">Demo</a>
and element with the same ID as in anchors href - "demo":
<div id="demo">
Demo element.
</div>