jquery - Javascript onClick movement + slide function -
i'm trying fix due previous persons mistake. me out? onclick of arrow menu moves right , when gets end hides , left arrow appears. thing is, moving small steps want move end of container.
also, want slideable on mobile devices. give me hand?
tab.prototype.initializescrolling = function () { var $switchers = this.$scope.find(".tabs-nav-switcher"), $switcherright = $switchers.filter(".tabs-nav-switcher-right"), $switcherleft = $switchers.filter(".tabs-nav-switcher-left"), $list = this.$scope.find(".tabs-nav-list"), self = this; $switcherright.removeclass("is-hidden"); $switchers.on("click", function () { var $this = $(this), difference = $this.hasclass("tabs-nav-switcher-right") ? -20 : 20, nextleft = (parseint($list.css("left"), 10) + difference); if (nextleft < 0) { $switcherleft.removeclass("is-hidden"); if (-1 * nextleft >= self.listwidth - self.navwidth) { $switcherright.addclass("is-hidden"); } else { $switcherright.removeclass("is-hidden"); } } else { $switcherleft.addclass("is-hidden"); } $list.stop().animate({left: nextleft + "px"}); }); };
Comments
Post a Comment