/** * jQuery ScrolTable v1.0.1 * https://github.com/cytim/jquery-scroltable * * Copyright 2016 Tim Wong * Released under the MIT license * * Date: 2016-06-21 */ !function(e,r){"use strict";function t(){var e=r(this),t=e.closest(".scroltable-wrapper"),l=t.children(".scroltable-nav-left"),a=t.children(".scroltable-nav-right"),s=t.children(".scroltable-container"),n=s.scrollLeft();s.width()0?l.finish().fadeIn():l.finish().fadeOut(),e.outerWidth(!0)-s.width()>n?a.finish().fadeIn():a.finish().fadeOut()):(l.finish().hide(),a.finish().hide())}function l(){c.each(t)}function a(){var e=r(this),l=e.parent(),a=l.children(".scroltable-container"),s=a.scrollLeft()+(e.is(".scroltable-nav-left")?-100:100);a.animate({scrollLeft:s},300,t.bind(a.children(".scroltable")[0]))}function s(){return c&&c.length&&this.each(function(){var e=r(this),t=c.not(e);t.length'),i=r('
'),o=r('
'),h=this.addClass("scroltable").wrap(n).before(i).wrap(o);return c=c?c.add(h):h,h.each(function(){r(this).closest(".scroltable-wrapper").children(".scroltable-nav").on("click.scroltable-wrapper",a).end().children(".scroltable-container").on("scroll.scroltable-wrapper",t.bind(this))}),r(e).off("resize.scroltable-wrapper").on("resize.scroltable-wrapper",l).trigger("resize.scroltable-wrapper"),this}var c;r.fn.scroltable=function(e){return"string"==typeof e?n.apply(this,arguments):i.apply(this,arguments)}}(this,jQuery);