Created
June 20, 2014 14:24
-
-
Save nyilmaz/8e66694cfe5827d9361e to your computer and use it in GitHub Desktop.
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
| var jcarouselSkeletonObject = { | |
| default: { | |
| jcarouselSel: '.jcarousel', | |
| jcarouselOptions: {}, | |
| jcarouselPaginationOptions: {}, | |
| jcarouselControlPrevSel: '.jcarousel-control-prev', | |
| jcarouselControlNextSel: '.jcarousel-control-next', | |
| jcarouselPaginationSel: '.jcarousel-pagination', | |
| slideCount: 1 | |
| }, | |
| bind: function (options) { | |
| this.options = $.extend({}, this.defaults, options); | |
| var _this = this; | |
| /* | |
| Carousel initialization | |
| */ | |
| $(this.options.jcarouselSel) | |
| .jcarousel(_this.options.jcarouselOptions); | |
| /* | |
| Prev control initialization | |
| */ | |
| $(this.options.jcarouselControlPrevSel) | |
| .on('jcarouselcontrol:active', function() { | |
| $(this).removeClass('inactive'); | |
| }) | |
| .on('jcarouselcontrol:inactive', function() { | |
| $(this).addClass('inactive'); | |
| }) | |
| .jcarouselControl({ | |
| // Options go here | |
| target: '-=' + _this.options.slideCount | |
| }); | |
| /* | |
| Next control initialization | |
| */ | |
| $(this.options.jcarouselControlNextSel) | |
| .on('jcarouselcontrol:active', function() { | |
| $(this).removeClass('inactive'); | |
| }) | |
| .on('jcarouselcontrol:inactive', function() { | |
| $(this).addClass('inactive'); | |
| }) | |
| .jcarouselControl({ | |
| // Options go here | |
| target: '+=' + _this.options.slideCount | |
| }); | |
| /* | |
| Pagination initialization | |
| */ | |
| $(this.options.jcarouselPaginationSel) | |
| .on('jcarouselpagination:active', 'a', function() { | |
| $(this).addClass('active'); | |
| }) | |
| .on('jcarouselpagination:inactive', 'a', function() { | |
| $(this).removeClass('active'); | |
| }) | |
| .jcarouselPagination(_this.options.jcarouselPaginationOptions); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment