question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parallax can't find image - based on the parallax demo project

See original GitHub issue

Steps to reproduce

I setup a new project with vue init vuetifyjs/webpack-advanced and adding the Parallax demo. I wanted to split each parts (header/footer/sections) as standalone components.

The 2 sections with the parallax cannot find the source image. I have two 404 errors on the console. I’m sure about the relative path I put because the main LOGO has the same base path than the two others and it rendered (../assets/vuetify.png vs ../assets/hero.jpeg, see below)

Versions

Vue : 2.4.2 Vuetify: 0.15.0 MacOS: 10.12.6 Chrome: 60.x

What is expected ?

Can see the source img in the 2 parallax sections.

What is actually happening ?

Can’t see the source img in the 2 parallax sections.

Reproduction Link

I don’t know how to give you reproduction link so here the code I have.

img available on /src/assets/hero.jpeg

/src/components/Hero.vue


<template>

  <div class="">

    <section>
      <v-parallax src="../assets/hero.jpeg" height="600">
        <v-layout column align-center justify-center class="white--text">
          <img src="../assets/vuetify.png" alt="Vuetify.js">
          <h1 class="white--text mb-2 display-3">Golf Watcher</h1>
          <div class="headline mb-3 text-xs-center">Powered by Vuetify</div>
          <v-btn class="blue lighten-2 mt-5" dark large href="/pre-made-themes">
            Get Started
          </v-btn>
        </v-layout>
      </v-parallax>
    </section>

  </div>

</template>

<script>
export default {
  data () {
    return {

    }
  }
}
</script>

<style scoped>

</style>

Do you think the issue is here because of vue-router that cannot give the path or something ?

EDIT: I made a test. If I just change the <v-parallax> for a <img> I have the img. So there is a real problem with the src props of v-parallax

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

10reactions
gfelotcommented, Sep 10, 2017

I’m still with npm run dev compared to this issue. And the quick fix :src="require('@/assets/hero.jpeg')" load only half of the image. screen shot 2017-09-10 at 18 20 19

EDIT: An hard refresh make my img the correct size 😉

2reactions
rondaniel00commented, Jul 12, 2018

@johnleider Hi, I noticed that if I move the assets folder to /public then it will work. Is this information helps ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Parallax Effect // 5 Minute WebDev Project - YouTube
The Parallax Effect is an optical illusion that can give a website the appearance of 3D depth. Learn how to design a parallax...
Read more >
parallax with 1 image - Stack Overflow
Technically, it's impossible to get parallax with just one, 2-D image. You can shift the whole image, like DhruvPathak's answer, but that's not...
Read more >
Simple Parallax Scrolling Effect with jQuery - GitHub Pages
To easily add a parallax effect behind an element, add data-parallax="scroll" to the element you want to use, and specify an image with...
Read more >
Why Doesn't Parallax Scrolling Work on Mobile?
Parallax scrolling doesn't work on Mobile? Learn why this is happening and what ... As a result, you will only see a static...
Read more >
Parallax Effect in ReactJS - Dev Genius
The final animation is taking form, and you can see that each image has a different extend and speed. The moon, for example,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found