Comments (6)
I was able to fix this by including this function:
jumpTo = (obj) => {
scrollTo({
top: document.querySelector(obj).offsetTop,
left: 0,
behavior: 'smooth'
});
window.location = `${obj}`;
};
And modifying the "a" tag like so:
<a onclick="jumpTo('#home')" class="class-name" href="#home">Link Text</a>
However, with this solution, it is not possible to send a link and directly go to a specific spot in the page unless you use a separate function like this one:
//make sure luxy is initiated before this function is called
window.addEventListener("load", () => {
if(window.location.href.split("#")[1] != null) {
jumpTo(`#${window.location.href.split("#")[1]}`);
};
});
Note: I haven't tested this on my site as it has a load animation which doesn't let the user scroll.
from luxy.js.
I am also having this issue. I have the site wrapped in one div with `id="luxy". The demo site does appear to work though if I provide a hash in the url with an ID though.
from luxy.js.
I experience exactly the same problem. The exact same problem occurs also with another library 'butter.js', which does the same (smooth/ease scrolling).
Only disabling the plugin makes the on-page-anchor tags work. But having both, does not seem to be a possibility.
Details: when you click on an anchor tag which is linked to an id on the same page, nothing happens. Only the url changes, but the position remains the same.
from luxy.js.
I was able to fix this by including this function:
jumpTo = (obj) => { scrollTo({ top: document.querySelector(obj).offsetTop, left: 0, behavior: 'smooth' }); window.location = `${obj}`; };And modifying the "a" tag like so:
<a onclick="jumpTo('#home')" class="class-name" href="#home">Link Text</a>
However, with this solution, it is not possible to send a link and directly go to a specific spot in the page unless you use a separate function like this one:
//make sure luxy is initiated before this function is called window.addEventListener("load", () => { if(window.location.href.split("#")[1] != null) { jumpTo(`#${window.location.href.split("#")[1]}`); }; });Note: I haven't tested this on my site as it has a load animation which doesn't let the user scroll.
true hero
from luxy.js.
I was able to fix this by including this function:
jumpTo = (obj) => { scrollTo({ top: document.querySelector(obj).offsetTop, left: 0, behavior: 'smooth' }); window.location = `${obj}`; };And modifying the "a" tag like so:
<a onclick="jumpTo('#home')" class="class-name" href="#home">Link Text</a>
However, with this solution, it is not possible to send a link and directly go to a specific spot in the page unless you use a separate function like this one:
//make sure luxy is initiated before this function is called window.addEventListener("load", () => { if(window.location.href.split("#")[1] != null) { jumpTo(`#${window.location.href.split("#")[1]}`); }; });Note: I haven't tested this on my site as it has a load animation which doesn't let the user scroll.
ty :)
from luxy.js.
This is because the library adds a div with position fixed to all the page, a fixed element don't scroll and that's why you can't scroll with an anchor you have to specify the translate position you want to go
from luxy.js.
Related Issues (20)
- Turn off Luxy.js in Firefox HOT 2
- refresh or remove luxy.js HOT 1
- delete
- Luxy is disabling my page transitions with SWUP
- Luxy is stopping my page transitions with SWUP.js HOT 4
- Issue on PHP and Google Chrome HOT 1
- Second usage of luxy.init() problem HOT 2
- Elements jitter in firefox and Edge and scrolling in android lags
- How to center the parallax elements
- Bad performance on Safari MacBook Pro HOT 1
- Parallax Elements Move Rough on Safari HOT 3
- Elements animate immediately as the page scrolls and not based on viewport HOT 3
- Scroll bug with chrome and safari navigation bar on IOS
- luxy.min.js issue in our wordpress website.
- Horizontal text scroll not working
- How to trigger the animation when an item comes in the viewport?
- Parallax elements further down the page are extremely mispositioned!
- Importing issue in react js project HOT 1
- Position: Sticky not possible?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luxy.js.