Git Product home page Git Product logo

在移动端使用滑动的时候,我滑到的当前位置的图片不能显示,需要额外添加事件才能触发使得图片显示;在pc端需要只有滚轮滚到的地方才显示图片,手机模式拖动也是当前位置不显示图片…… about vue-lazyload HOT 13 CLOSED

hilongjw avatar hilongjw commented on July 26, 2024
在移动端使用滑动的时候,我滑到的当前位置的图片不能显示,需要额外添加事件才能触发使得图片显示;在pc端需要只有滚轮滚到的地方才显示图片,手机模式拖动也是当前位置不显示图片……

from vue-lazyload.

Comments (13)

hasbug avatar hasbug commented on July 26, 2024 1

至今仍存在,滑动停止后,还需要在上下滑一下才显示。。

from vue-lazyload.

hilongjw avatar hilongjw commented on July 26, 2024

@zhaozhaobaiping 可以提供一下 移动端的系统和浏览器信息

from vue-lazyload.

zhaozhaoduan avatar zhaozhaoduan commented on July 26, 2024

Android和iOS都是,运行在微信浏览器里面

from vue-lazyload.

hilongjw avatar hilongjw commented on July 26, 2024

@zhaozhaobaiping 在线demo 是没有问题的,http://hilongjw.github.io/vue-lazyload/ ,可否看一下有没有相关报错 logs

from vue-lazyload.

zhaozhaoduan avatar zhaozhaoduan commented on July 26, 2024

如果报错还好,还能找到问题在呢。关键就是没有报错。主要是鼠标滚轮滚动的话没问题,滚到的地方就加载,关键是在手机上滑动到的地方不能加载,需要额外一个事件来触发,比如我给这个图加一个单击事件,那么附近的三张图片就会加载,不加事件就不加载,会不会是布局有局限呢

from vue-lazyload.

hilongjw avatar hilongjw commented on July 26, 2024

@zhaozhaobaiping 是元素内滚动的吗?

from vue-lazyload.

zhaozhaoduan avatar zhaozhaoduan commented on July 26, 2024

是的,项目是做点餐的。我在页面有一个一个tab页,其中有一个是菜品列表,列表里面有多个关于菜品的图片、价格、名字。
我这边上github比较慢,有没有邮箱之类的,我可以发一些截图之类的

from vue-lazyload.

hilongjw avatar hilongjw commented on July 26, 2024

@zhaozhaobaiping 尝试设置一下父元素

<ul id="container">
  <li v-for="img in list">
    <img v-lazy.container="img">
  </li> 
</ul>
<ul id="container">
  <li v-for="img in list">
    <div v-lazy:background-image.container="img"></div>
  </li> 
</ul>

from vue-lazyload.

zhaozhaoduan avatar zhaozhaoduan commented on July 26, 2024
 <div id="dish_wrapper">
        <ul id="container" @touchmove='computHeight($event)'>
          <li v-for="category in categories" class="js-dish">
            <div class="dish" v-for="dish in category.dishes">
              <div class="dish-picture"  v-lazy:background-image.container="dish.thumb">
              </div>
              <div class="dish-detail">
                <div class="flag">
                  <div class="flag-item">
                    ¥{{dish.price}}/份
                  </div>
                  <div class="flag-item">
                    <i class="sub"  @click='subDish(dish)' v-if='dish.quantity'></i>
                    <span  v-if='dish.quantity'>{{dish.quantity}}</span>
                    <i class="plus"  @click='plusDish(dish)'></i>
                  </div>
                </div>
                <p>{{dish.title}}</p>
              </div>
            </div>
          </li>
        </ul>
      </div>

还是不行

from vue-lazyload.

zhaozhaoduan avatar zhaozhaoduan commented on July 26, 2024

<div id="dish_wrapper"> <ul id="container" @touchmove='computHeight($event)'> <li v-for="category in categories" class="js-dish" @click.stop='helpme'> <div class="dish" v-for="dish in category.dishes"> <div class="dish-picture" v-lazy:background-image.container="dish.thumb"> </div> </div> </li> </ul> </div>
我按照您说的在父元素上设置了 还是不行 麻烦您再看一下

from vue-lazyload.

mengchen129 avatar mengchen129 commented on July 26, 2024

@zhaozhaobaiping 你的id=container的元素是页面加载时立即绘制到body中的么?我看了vue-lazyload的源码,如果你的父元素延迟出现在页面中,是不会给它绑定scroll事件的,这样会导致滚动时不继续加载图片。

from vue-lazyload.

hilongjw avatar hilongjw commented on July 26, 2024

@mengchen129 之前没考虑到你说的这个场景,我会增加实例方法来主动添加对scroll el 的监听

from vue-lazyload.

774649283 avatar 774649283 commented on July 26, 2024

至今仍存在,滑动停止后,还需要在上下滑一下才显示。。

确实在手机端滑动时候不显示图片,需要再次滑动才显示。在浏览器中用鼠标滚轮滑动无此问题

from vue-lazyload.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.