Code Monkey home page Code Monkey logo

Comments (3)

MapoMagpie avatar MapoMagpie commented on September 28, 2024

应该是因为

      // delay to reduce the image element in big image frame;
      this.debouncer.addEvent("REDUCE", () => {
        const distance = this.getRealOffsetTop(this.elements.curr[0]!) - this.frame.scrollTop;
        if (this.tryReduce()) {
          this.restoreScrollTop(this.elements.curr[0]!, distance);
        }
      }, 500);

这里有个500毫秒后,移除视图外的大图的功能。
如果在500毫秒内退出了大图阅读模式,由于所有的大图都已经被删除了(this.hidden > this.resetElements)。
所以最后在这个功能被延迟执行的时候,this.elements.curr[0]!是undefind的,就报错了。(this.elements.curr[0]就是大图视图中最中心的图片)
这个移除视图外大图的功能,是为了防止太多的大图留在页面,增加渲染压力。(我猜的)

from eh-view-enhance.

MapoMagpie avatar MapoMagpie commented on September 28, 2024

我再想想有什么更好的方式来提升性能,现在图片多了后会增加数倍的内存占用。

from eh-view-enhance.

MapoMagpie avatar MapoMagpie commented on September 28, 2024

65c32f3

from eh-view-enhance.

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.