javascript - Understanding bootstrap carousel code -
hey guys new js , jquery in general , going through source of carousel.js , came across following line of code:
this.cycle(true) now cycle function looks this:
carousel.prototype.cycle = function (e) { // console.log('inside cycle'); e || (this.paused = false) this.interval && clearinterval(this.interval) this.options.interval && !this.paused && (this.interval = setinterval($.proxy(this.next, this), this.options.interval)) return } if console.log(e), never 'true' why? line referring can found here.
can explain me why this.cycle() being passed value true on line?
thank you.
console.log(e) inside cycle function should return true. breakdown of code makes easier understand this:
carousel.prototype.cycle = function (e) { // console.log('inside cycle'); //e || (this.paused = false) if(!e){ this.paused=false; } //this.interval && clearinterval(this.interval) if(this.interval){ clearinterval(this.interval); } /* this.options.interval && !this.paused && (this.interval = setinterval($.proxy(this.next, this), this.options.interval)) */ if(this.options.interval && !this.paused){ this.interval = setinterval($.proxy(this.next, this), this.options.interval) } return }
Comments
Post a Comment