svgClippedSlider


SUBMITTED BY: abdallahali690

DATE: Sept. 15, 2016, 6:15 p.m.

FORMAT: Text only

SIZE: 774 Bytes

HITS: 548

  1. function svgClippedSlider(element) {
  2. this.element = element;
  3. this.slidesGallery = this.element.find('.gallery').children('li');
  4. this.slidesCaption = this.element.find('.caption').children('li');
  5. this.slidesNumber = this.slidesGallery.length;
  6. this.selectedSlide = this.slidesGallery.filter('.selected').index();
  7. // ....
  8. this.bindEvents();
  9. }
  10. svgClippedSlider.prototype.bindEvents = function() {
  11. var self = this;
  12. //detect click on one of the slides
  13. this.slidesGallery.on('click', function(event){
  14. if( !$(this).hasClass('selected') ) {
  15. //determine new slide index and show it
  16. var newSlideIndex = ( $(this).hasClass('left') )
  17. ? self.showPrevSlide(self.selectedSlide - 1)
  18. : self.showNextSlide(self.selectedSlide + 1);
  19. }
  20. });
  21. }

comments powered by Disqus