Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

Sahil last won the day on November 25 2018

Sahil had the most liked content!

Sahil

Moderators
  • Content Count

    999
  • Joined

  • Last visited

  • Days Won

    71

Sahil last won the day on November 25 2018

Sahil had the most liked content!

Community Reputation

2,627 Superhero

About Sahil

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

12,484 profile views

Single Status Update

See all updates by Sahil

  1. Hi Sahil, I was trying to expand on a codepen that you did called "Draggable with Snap" and would love some help, if you could (Ive linked to your codepen below) . Question(s), How can I assign an 'active' class to whichever the current slide might be? And just one other thing :), I'd like to add new slides on the fly, so I made a button that appends a new slide instance to the #slider div - and it shows up in the console - but, not in the slider with the other slides. Ive been having a hard time with this and would greatly appreciate any help you could offer. Thanks!

     

     

    1. Sahil

      Sahil

      Hi Jesse,

       

      Seems like you attached my pen. Here is how you can add active class to a slide, check code added in setProgress function,

       

       

      To add new slides, you need to reselect slides in jQuery so the new elements will be selected. You need to recalculate the sliderLength to accommodate the added elements and you need to calculate the x translate of the '#slider'. Basically you need to do what I am doing on resize event.

       

      If you have anymore questions please post them in the Forum where others can see it.

    2. JesseShugart

      JesseShugart

      Thanks so much for your help, Sahil.

×