stephband / jquery.event.swipe

jQuery custom events swipeleft, swiperight, swipeup and swipedown
stephband.info/jquery.event.swipe
446 stars 180 forks source link

Add active class to slide button #20

Closed pemasat closed 10 years ago

pemasat commented 10 years ago

Hi, i made a little path for select active slide button. Can you add to master tree? Thank's, Petr Mašát

From c14153e25820f31ddec7734a64d5d57feaf81a23 Mon Sep 17 00:00:00 2001
From: Petr Mašát <petr.masat@onlio.com>
Date: 28.3.2014 11:31:46

Select active class for slide button

diff --git a/index.html b/index.html
index 24400d4..f8b62fb 100644
--- a/index.html
+++ b/index.html
@@ -251,6 +251,10 @@

                    // Update the active slide index
                    i = slides.index(e.target);
+                   
+                   // select active class for slide button
+                   jQuery('.slide_button').removeClass('active');
+                   jQuery('.slide_button').eq(i).addClass('active');
                })

                // The code below handles what happens before any swipe event is triggered.
stephband commented 10 years ago

https://github.com/stephband/jquery.event.swipe/commit/f9b9c730fe4fb7cb8a3a47ad00ea79b1f05a6881