# # 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 = $('