Last active
December 11, 2015 07:28
-
-
Save derekblank/4566724 to your computer and use it in GitHub Desktop.
Responsive addition for slides.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class HeroSlider | |
| constructor: -> | |
| @hero_slider = $('#hero_slider') | |
| @all_slides = @hero_slider.find('.slide') | |
| @setContainerWidth() | |
| @init() | |
| init: => | |
| @hero_slider.slides | |
| next: 'control-right' | |
| prev: 'control-left' | |
| paginationClass: 'tabs' | |
| generatePagination: false, | |
| generateNextPrev: false | |
| $(window).resize => | |
| @setContainerWidth() | |
| @all_slides.click -> | |
| window.location = $(@).data('url') | |
| setContainerWidth: -> | |
| container_width = $(window).width() | |
| @all_slides.css 'width', container_width | |
| $ -> | |
| new HeroSlider |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment