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

Sahil last won the day on March 31

Sahil had the most liked content!

About Sahil

Contact Methods

Recent Profile Visitors

19,246 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 test

      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 test

      JesseShugart

      Thanks so much for your help, Sahil.

×
×
  • Create New...