Jump to content
Search Community

Alexis_G

Premium
  • Posts

    6
  • Joined

  • Last visited

Posts posted by Alexis_G

  1. Hi,

     

    I'm building something like this for a mobile view (in a Vue.js webApp), everything work properly on desktop, but the snap doesn't work on Safari / Chrome mobile.
    I tried many things (like using type: 'y' instead) but the problem is still the same...

     

    Any help would be appreciated,

     

    Thanks.

    See the Pen OJLNaZw by yyy589 (@yyy589) on CodePen

  2. Hi,

     

    I use the Draggable plugin locked on the y axis to manage scrolling in a section. I would like to retrieve the y position of the scrolled element to trigger an event when reaching the end of the scroll area. It's working as follow when the user drag but not when he use the mouse wheel for ex.

     

    Draggable.create(Pr, {
      type: 'scrollTop',
      ...
      onDrag: function(e) {
        type: 'scrollTop',
        this.update()
        console.log(this.y)
      }
    })

     

    How can I get a unified way to retrieve the y position between the different events, drag, scroll, etc.

  3. Hi,

     

    I'm using in components navigation guards with vue router to manage transitions between vues but can't get the onComplete firing the "next" argument:

     

      beforeRouteLeave(to, from, next) {
        const self = this
        const { Im } = self.$refs
        const tl = new self.TimelineLite
        tl.to(Im, .4, {
          y: -40, 
          opacity: 0,
          onComplete: next
        })
      }

     

    So I ended up with this kind of hacky solution:

     

      beforeRouteLeave(to, from, next) {
        const self = this
        const { Im } = self.$refs
        const tl = new self.TimelineLite
        tl.to(Im, .4, {
          y: -40, 
          opacity: 0,
          // onComplete: next
        })
        setTimeout(function(){
          next()
        }, 400)
      },

     

    Any ideas about how I could actually trigger the "next()" argument with the onComplete callback?

    Thks.
     

×
×
  • Create New...