当我正在阅读文档轮播部分中的bootstrap.js文件时,我并不完全明白这句话是什么
this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
必须在函数内部做,我不想理解它自己的意思是什么,但这显然是一个布尔语句必须在函数内部做这是代码
+function ($) {
'use strict'
var Carousel = function (element, options) {
this.$element = $(element)
this.$indicators = this.$element.find('.carousel-indicators')
this.options = options
this.paused = null
this.sliding = null
this.interval = null
this.$active = null
this.$items = null
this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
.on('mouseenter.bs.carousel', $.proxy(this.pause, this))
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
}
}(jQuery)