Skip to content
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

Footer Logo click should scroll to top on home page #37

Open
rileywong311 opened this issue Jun 14, 2023 · 0 comments
Open

Footer Logo click should scroll to top on home page #37

rileywong311 opened this issue Jun 14, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@rileywong311
Copy link
Contributor

rileywong311 commented Jun 14, 2023

image

This is a good first issue. SCU ACM members are especially encouraged to try this out.!

Clicking this SCU ACM logo on the footer takes you back to the homepage (via the Vue.js router). However, when already on the homepage it does nothing. It would be a nice feature to scroll back up to the top of the page when this is clicked on the homepage.

Likely, this involves the <element>.ScrollTo / <element>.ScrollIntoView JavaScript function (and perhaps a Vue.js component method to run this). The element will have to be accessed somehow. I've found ways to do this through the CSS id styling, but there might be a way to do it with Vue.js refs.

For example, I've done something like this before:

async toHome() {
    await this.$router.push('/')
    const element = document.getElementById("Title");
    element.scrollIntoView({behavior: 'smooth'}); 
},
@rileywong311 rileywong311 added enhancement New feature or request good first issue Good for newcomers labels Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant