jquery - How to stop all animation in this image slider carousel UNLESS the arrow is clicked? -
is located on the carousel
what the site owner wants to do, until it has the image slider Do not click on any green arrow, and then it will move only once. Alternatively, he wants to slog it very slowly, maybe once every 5 minutes. The code for this slider is below ... Please note that I have no clue about any of this code, I'm a newbie with JS. Thanks a lot! :)
$ (document) .ready (function () {$ ('# sliderGallery'). Slider ();}); (Function ($) {$ .fn.Slider = function (params) {var defaults = {moveLeft: true, onItem: false, isAnimating is: incorrect, timer: empty), intialize = function (id) {//// ///////////////////////////////////////////////// /////////// Bowers' Howers Events on the left and right buttons ////////////////////////////// //////////////////////////////// $ ('div # leftButton'). Hover (function ($) (this) .addClass ('leftImageHov'); Clear interval (defaults.timer);}, function () {$ (this) .removeClass ('leftImageHov'); setTimer ();}) ; $ ('Div # hover (function) ($ (this) .addClass (' rightImageHov '); Clear interval (defaults.timer);}, function () {$ (this) .removeClass (' rightImageHov '); setTimer );}); ///////////////////////////////////////////// Stop the mouse on items ////////////////// /////////////////////////////////// $ ('# canvas ul li'). Hover (Function () {clear interval (defaults.timer);}, function () {setTimer ();}); //////////////////////// Size of //////////////////////////////////////// #Canvas ul & amp; Correct ////////////////////////////////////////////// ////////////////// var Leo = $ ('# canvas ul li'); var liWidth = li.eq (0) .With (); var liCount = li. Length; $ ('# canvas ul') CSS ({width: liWidth * liCount + 'px', left: '0px'}); ///////////////////////////// /////////////////////////////////// Click on the event on the left and right buttons // /////////////////////////////////////////////// //////////// Left Limit = (liWidth * liCount) - $ ('div # canvas'). Width (); $ ('Div # leftButton') Click (function () (if (Default!), Animate (liWidth, 600, leftLimit);}) $ ('Div # right button'). (Function () (if (Default! Animate (+ 1 * liWidth, 600, left limit);}); Add timer ();}, setimer = function () {defaults.timer = setInterval (doAnimation, 30000);}, Animate = function , Time, left limit) {defaults.isAnimating = true; var leftVal = $ ('div # canvas ul'). CSS ('left'); LeftVal = leftVal.replace ('px', ''); LeftVal = leftVal * 1; zodiac + = left wing; ///////////////////////////////////////// /////////////////////////Range Checks ///////////////////// ///////////////////////////////////////// If (amount & lt; ( -1 * left Limit)} {zodiac = (-1 * leftLimit); Defaults.moveLeft = false;} If (amount> 0) {zodiac = 0; Defaults.moveLeft = true;} $ ('Div # canvas ul'). Animate ({left: zodiac}, time, work () {defaults.isAnimating = false;});}, ///////////////////////// /////////////////////// //////////////// Animation ///// ///// //////////////////////////////////////////////// //// doAnimation = function () {var le = $ ('# canvas ul li'); Var liWidth = li.eq (0). With (); Var liCount = li.length; Var leftLimit = (liWidth * liCount) - $ ('div # canvas') width (); Var eninv = lwind * 3; If (default.mov left) animevalue * = -1; Other animValue = leftLimit; Animate (animate value, 0, left limit); } Give it back (Function () (intialize (this);});}}) (jquery); To change animation slides every 5 minutes:
set timer = function () {defaults.timer = setInterval (doAnimation, 30000); }, to
setTimer = function () {defaults.timer = setInterval (doAnimation, 150000); },
Comments
Post a Comment