Jump to content
Search Community

vishal_codes

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by vishal_codes

  1. Hi @Cassie

    13 hours ago, Cassie said:

    Hi Vishal! (fyi - We're not all sir's)  Sorry Mam! I just wanted to Salute whoever is going to reply. I apologize

    At the moment overflow:hidden is breaking everything - there's nothing to scroll to.

     

    Are you maybe trying to scroll horizontally?

    Many Thanks for reply

    I have achieved what i was looking for....

    • Like 1
  2. Hey guys,

    var panWidth = $(".panContain").width();
    var panImg = $(".panContain").find(".panImg");
    var start = 50;
    var width = panImg.width() - panWidth;
    var tl = new TimelineMax({
      onComplete: function onComplete() {
        start = 0;
        tl.reverse();
      },
      onReverseComplete: function onReverseComplete() {
        start = 0;
        tl.restart();
      }
    });
    tl.fromTo(panImg, 20, {
      "transform": "translate("+ -start +"px,0)",
    }, {
      "transform": "translate(-" + width + "px,0)",
      ease: Linear.easeNone
    });
    

    Please Help,

     

    Here i want to set from value to "transform": "translate("+ -start +"px,0)" only when start. onComplete i want to tl.reverse() to "transform": "translate(0,0)" not 50 then again restart it from "transform": "translate(0,0)" not 50. Above my code does not reset start to 0 onComplete.

    See the Pen jBqpxe by vishalbhulku (@vishalbhulku) on CodePen

×
×
  • Create New...