Skip to content

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

Description

@rileywong311
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'}); 
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions