From 4ba4ccc3fddb242251d5442c78aba14f43835035 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Mon, 22 Apr 2019 12:35:05 +0530 Subject: created index page --- touch/js/miniSlider.coffee | 235 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100755 touch/js/miniSlider.coffee (limited to 'touch/js/miniSlider.coffee') diff --git a/touch/js/miniSlider.coffee b/touch/js/miniSlider.coffee new file mode 100755 index 0000000..091fc1f --- /dev/null +++ b/touch/js/miniSlider.coffee @@ -0,0 +1,235 @@ +# +# miniSlider, a slider plugin for jQuery +# Instructions: http://minijs.com/plugins/7/slider +# By: Matthieu Aussaguel, http://www.mynameismatthieu.com, @mattaussaguel +# Version: 1.0 Stable +# More info: http://minijs.com/ +# +class Slide + constructor: (@element, @index, @options) -> + @element.css { position: 'absolute', top: 0, left: @index * @element.width() } + +class Slider + constructor: (@container, @options) -> + @state = 'waiting' + + @size = + height: @container.height() + width: @container.width() + + @container.css({ overflow: 'hidden', position: 'absolute', top: 0, left: 0 }) + .wrap("
") + @wrapper = @container.parent() + + @initSlides() + + appendNavigation: -> + @wrapper.after(@nextLink()) + .after(@previousLink()) + + @nextLink().on 'click', => + @stopAutoplay() + @next() + return false + + @previousLink().on 'click', => + @stopAutoplay() + @previous() + return false + + appendPagination: -> + @wrapper.after(@pagination()) + + @pagination().on 'click', 'a', (e) => + @to (($ e.currentTarget).data().index - 1 ) + @stopAutoplay() + return false + + previousLink: -> @$previousLink ||= $('', { html: @options.previousBtnContent, class: @options.previousBtnClass, href: '#' }) + + nextLink: -> @$nextLink ||= $('', { html: @options.nextBtnContent, class: @options.nextBtnClass, href: '#' }) + + pagination: -> + unless @$pagination + @$pagination = $('