Jump to content
Search Community

Sahil last won the day on March 31

Sahil had the most liked content!

Sahil

Business
  • Posts

    1,015
  • Joined

  • Last visited

  • Days Won

    72

Posts posted by Sahil

  1. Hi Blake,

     

    Thanks for helping me out. I went ahead and updated my demo further, I was able to wrap elements.

     

    I didn't use magical methods like you do, I basically calculated this.x plus the distance each element traveled in either direction and updated their xPercent to lowest or highest. It works as I would like, I will just clean up my code and update the demo.

  2. Thanks Blake, I decided to use your other pen and have posted another question. It is responsive and draggable, I just need some help with wrapping calculation and wrapping while dragging.

     

    EDIT: I was able to make it responsive but couldn't convert it into autoplay as you have used single Tween so I wasn't sure if tweens can be tweened partially so decided to use other pen.

  3. Hi,

     

    At the moment I am working on a infinite carousal which can be dragged as well. I was able to add draggable functionality to Blake's pen but how can I duplicate modifier's wrapping behaviour for draggable? So the entire carousal is in xPercent and draggable updates x while dragging.

     

    Also, Can someone explain calculation done here?

     

        function wrapPartial(min, max){
            var r = max - min;
    
            return function(value){        
                var v = value - min;
                return ((r + v % r) % r) + min;
            }
        }

     

    I don't understand what it does exactly and where does 'value' come from.

     

    Thanks.

    See the Pen veLaxP by Sahil89 (@Sahil89) on CodePen

  4. I tried to search a codepen by Blake, it is nice example to get started. I had tried to create draggable infinite slider, it took me 5 different approaches and almost 3 days to get it right.

     

    I will suggest you to create basic slider that goes to left and to right, then use draggable with container as trigger(check docs). Dragging will update x on all slides and on release set x to zero and slide all slides depending on direction using xPercent. Once you figure this out you can make it more complex without much issues, just start by small attempts. I don't have code that will help you instead of confusing you, and it really takes a lot of time to wrap your head around something that seems so simple. There was some recent thread where Blake had posted his codepen that will help you.

    • Like 2
  5. No it states that GSAP will use jQuery(only dollar sign) as it is very commonly used and that you don't need to do anything else to use jQuery as selector if you are already using it. But you have freedom to use other selector engines if you want. Seemed pretty straight forward to me.

    • Like 1
  6. Yes it is correct. If jQuery is available on page then GSAP will use jQuery as selector. So you can pass first argument as if you are using jQuery selector instead of using jQuery syntax directly. So basically instead of writing

    TweenLite.to($('.myClass'), 1, {});

    you can write

    TweenLite.to('.myClass', 1, {});

     

    Note: GSAP only uses the dollar sign, so in case you are using anything else that uses $ sign, for example mootools then you will run into unexpected behaviors. In such cases you can use

     

    TweenLite.selector = YOUR_SELECTOR_ENGINE;

     

    and set selector of your choice, as stated right above docs you posted.

    • Like 2
  7. Quote

    The only way to circumvent all this is to call preventDefault() on the original touchstart event, but if you do that, it will refuse to allow any touch-scrolling.

    Ya I was going to ask if it will be good idea to follow thread I mentioned in previous reply, but ya it disables touch scrolling completely. Thanks.

     

    Quote

    Please let me know if you (or anyone else) can figure out a solution. 

    I had given up already  once I found out contextmenu is causing it and after reading your research I think only choice is to let it be.

     

    Sorry for assuming you are ignoring my thread. Thanks alot.

    • Like 1
  8. typeof ScrollToPlugin;

     

    returns "function" if ScrollToPlugin is available.


     

    if(typeof ScrollToPlugin === "function"){
    
    	//use ScrollToPlugin
    
    }

     

    Same can be used for 'CustomEase'.

  9. No that didn't help but I guess I will let it be.

     

    I think what it causes it is the browser feature to long press and select text etc. So just now I selected some text from random element in opera and tried long pressing on target element and onRelease event isn't firing anymore. Which is not any solution but explains what is happening or at least I guess so. Firefox on the other hand keeps behaving same even if you keep some text selected. Luckily chrome works fine.

     

    Edit: found this thread which does help me, I will see if I should use it or not.

×
×
  • Create New...