-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I cant navigate through sections #9
Comments
Have you found an answer to this issue? I just found this tutorial and I stumbled on the same issue |
Le jeu. 4 août 2022 à 11:16 PM, lalabrus1995 ***@***.***> a
écrit :
Have you found an answer to this issue? I just found this tutorial and I
stumbled on the same issue
—
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYG43YTL2YN4J5PBVHQJYIDVXQF2BANCNFSM52TP4OHQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
Unfortunately, no!
But with a simple search on youtube you can find out how it was done. If
you found anything related to this issue of scrolling i would appreciate if
you could share it with me too!
|
Will do... :) Thanks |
Hi! if anyone's having an issue with this like I was... another viewer had answered this problem on the comment section for the video. |
To me it worked to copy and paste the new js code in the project. |
i had the same problem as well it didn't work for me adding the zeros. I just deleted everything and retyped the code fro the function page transitions () { function PageTransitions(){ PageTransitions(); |
Yes, I recommend people to read the README.md on this page: https://github.com/Dyrits/PORTFOLIO/tree/main-fork-update The original code is available here: https://github.com/Maclinz/JS_CSS_PortfolioProject/tree/1f1c0205c0b3a8caa623c96402775974f39ab5cb |
@Dyrits could you figure out how to achieve full-page scroll? I liked your version and have been working on achieving that for hours and still no progress! Could you please give me some tips? |
You want to scroll from a section to another ? |
On Mon, May 1, 2023 at 8:22 PM hakunamatata97k ***@***.***> wrote:
@Dyrits <https://github.com/Dyrits> could you figure out how to achieve
full-page scroll? I liked your version and have been working on achieving
that for hours and still no progress! Could you please give me some tips?
I have tried the overflow: scroll; but it didn't help :(
—
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYG43YVEXMTI7WS4P5DKWXDXD7S5FANCNFSM52TP4OHQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
Hi dude!
I'm not the developer of this source code also I haven't coded front end
lately that it's been almost 1 year!
I have no clue how to fix this problem!
Sorry to say that but ask others!
|
The best way would be to set |
(function () {
[...document.querySelectorAll(".control")].forEach(button => {
button.addEventListener("click", function() {
document.querySelector(".active-btn").classList.remove("active-btn");
this.classList.add("active-btn");
document.querySelector(".active").classList.remove("active");
document.getElementById(button.dataset.id).classList.add("active");
window.scrollTo(0, 1)
})
});
document.querySelector(".theme-btn").addEventListener("click", () => {
document.body.classList.toggle("light-mode");
})
scroll();
})();
function scroll() {
document.addEventListener("scroll", function() {
let target;
if (window.scrollY >= window.scrollMaxY) {
target = document.querySelector(".active-btn").nextElementSibling;
} else if (window.scrollY <= 0) {
target = document.querySelector(".active-btn").previousElementSibling;
}
target && target.click();
});
} Here is the JavaScript code I made very quickly for that (so it is not the best), updated with the scrolling. To make it work, you have to add something to the body in the CSS: |
hey I ran into the same issue where the code wasn't running due to an error <TypeError: allSections.addEventListener is not a function> I tried to rectify it I looked in the comments I tried all the suggestions it didn't work, I copied the code and it still didn't work. Hopefully you can assist me with the java script |
HI guys. I have a problem that I cant navigate through pages with buttons.
I have checked my js file for thousand times and it still
doesn't
work.Also I receive <TypeError: allSections.addEventListener is not a function> this error.
I would appreciate if some one help.
` //sections active class
allSections.addEventListener('click' , (e) => {
const id=e.target.dataset.id;
if(id){
//remove selected from the other btns
sectBtns.foreach((btn) =>{
btn.classlist.remove('active');
})
e.target.classlist.add('active');
The text was updated successfully, but these errors were encountered: